Bug 787433 - IRC component should return a proper CTCP VERSION response. r=aleth, florian

This commit is contained in:
Patrick Cloke 2012-09-07 14:30:16 -04:00
Родитель ee5ebd2479
Коммит 23d4626048
3 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -33,7 +33,7 @@ ctcp.ping=Ping reply from %1$S in #2 second.;Ping reply from %1$S in #2 seconds.
# LOCALIZATION NOTE (ctcp.version):
# %1$S is the nickname of the user whose version was requested.
# %2$S is the version response from the client.
ctcp.version=%1$S is using "%2$S"
ctcp.version=%1$S is using "%2$S".
# LOCALIZATION NOTE (ctcp.time):
# %1$S is the nickname of the user whose time was requested.
# %2$S is the time response.

Просмотреть файл

@ -1120,7 +1120,7 @@ ircAccount.prototype = {
username = this.getString("username");
// But fallback to brandShortName if no username is provided (or is empty).
if (!username)
username = l10nHelper("chrome://branding/locale/brand.properties")("brandShortName");
username = Services.appinfo.name;
this.sendMessage("USER", [username, this._mode.toString(), "*",
this._realname || this._requestedNickname]);
},

Просмотреть файл

@ -12,6 +12,7 @@ const EXPORTED_SYMBOLS = ["ircCTCP", "ctcpBase"];
const Cu = Components.utils;
Cu.import("resource:///modules/imServices.jsm");
Cu.import("resource:///modules/imXPCOMUtils.jsm");
Cu.import("resource:///modules/ircHandlers.jsm");
Cu.import("resource:///modules/ircUtils.jsm");
@ -224,9 +225,7 @@ var ctcpBase = {
if (aMessage.command == "PRIVMSG") {
// VERSION
// Received VERSION request, send VERSION response.
// Use brandShortName as the client version.
let version =
l10nHelper("chrome://branding/locale/brand.properties")("brandShortName");
let version = Services.appinfo.name + " " + Services.appinfo.version;
LOG("Received VERSION request from " + aMessage.nickname +
". Sending VERSION response: \"" + version + "\".");
this.sendCTCPMessage("VERSION", version, aMessage.nickname, true);