зеркало из https://github.com/mozilla/gecko-dev.git
Bug 131604 - Use local environment to set default nickname.
ChatZilla only. r=rginda
This commit is contained in:
Родитель
a8ad73d870
Коммит
ab6ba04d26
|
@ -88,6 +88,29 @@ function initPrefs()
|
|||
"goto-url-external", "goto-url-external"];
|
||||
}
|
||||
|
||||
// Set up default nickname, if possible.
|
||||
var defaultNick = DEFAULT_NICK;
|
||||
var en = getService("@mozilla.org/process/environment;1", "nsIEnvironment");
|
||||
if (en)
|
||||
{
|
||||
/* Get the enviroment variables used by various OSes:
|
||||
* USER - Linux, Mac OSX and other *nix-types.
|
||||
* USERNAME - Windows.
|
||||
* LOGNAME - *nix again.
|
||||
*/
|
||||
const vars = ["USER", "USERNAME", "LOGNAME"];
|
||||
|
||||
for (var i = 0; i < vars.length; i++)
|
||||
{
|
||||
var nick = en.get(vars[i]);
|
||||
if (nick)
|
||||
{
|
||||
defaultNick = nick;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var prefs =
|
||||
[
|
||||
["activityFlashDelay", 200, "global"],
|
||||
|
@ -162,7 +185,7 @@ function initPrefs()
|
|||
["newTabLimit", 15, "global"],
|
||||
["notify.aggressive", true, "global"],
|
||||
["nickCompleteStr", ":", "global"],
|
||||
["nickname", DEFAULT_NICK, ".ident"],
|
||||
["nickname", defaultNick, ".ident"],
|
||||
["nicknameList", [], "lists.nicknameList"],
|
||||
["outgoing.colorCodes", false, "global"],
|
||||
["outputWindowURL", "chrome://chatzilla/content/output-window.html",
|
||||
|
|
Загрузка…
Ссылка в новой задаче