Bug 842183 - Land in comm-central Instantbird's changes to chat/ - 5 - Bio 1811 - IRC password does not work with ZNC/server password auth, r=aleth.

This commit is contained in:
Patrick Cloke 2012-11-22 10:31:46 -05:00
Родитель 99a3fa5aa4
Коммит 19fad72936
5 изменённых файлов: 33 добавлений и 4 удалений

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

@ -7,6 +7,8 @@
# disconnected because of an error.
connection.error.lost=Lost connection with server
connection.error.timeOut=Connection timed out
connection.error.invalidPassword=Invalid server password
connection.error.passwordRequired=Password required
# LOCALIZATION NOTE (joinChat.*):
# These show up on the join chat menu. An underscore is for the access key.

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

@ -696,6 +696,8 @@ ircAccount.prototype = {
_MODE_INVISIBLE: 1 << 3, // mode 'i'
get _mode() 0,
// Whether to attempt authenticating with NickServ.
shouldAuthenticate: true,
// Whether the user has successfully authenticated with NickServ.
isAuthenticated: false,
// The nickname stored in the account name.

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

@ -1261,8 +1261,9 @@ var ircBase = {
},
"464": function(aMessage) { // ERR_PASSWDMISMATCH
// :Password incorrect
// TODO prompt user for new password
return false;
this.gotDisconnected(Ci.prplIAccount.ERROR_AUTHENTICATION_FAILED,
_("connection.error.invalidPassword"));
return true;
},
"465": function(aMessage) { // ERR_YOUREBANEDCREEP
// :You are banned from this server

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

@ -25,6 +25,29 @@ var ircNonStandard = {
isEnabled: function() true,
commands: {
"NOTICE": function(aMessage) {
// NOTICE <msgtarget> <text>
// If we receive a ZNC error message requesting a password, the
// serverPassword preference was not set by the user. Attempt to log into
// ZNC using the account password.
if (aMessage.params[0] != "AUTH" ||
aMessage.params[1] != "*** You need to send your password. Try /quote PASS <username>:<password>")
return false;
if (this.imAccount.password) {
// Send the password now, if it is available.
this.shouldAuthenticate = false;
this.sendMessage("PASS", this.imAccount.password,
"PASS <password not logged>");
}
else {
// Otherwise, put the account in an error state.
this.gotDisconnected(Ci.prplIAccount.ERROR_AUTHENTICATION_IMPOSSIBLE,
_("connection.error.passwordRequired"));
}
return true;
},
"307": function(aMessage) {
// TODO RPL_SUSERHOST (AustHex)
// TODO RPL_USERIP (Undernet)

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

@ -52,7 +52,8 @@ var ircServices = {
priority: ircHandlers.HIGH_PRIORITY,
isEnabled: function() true,
sendIdentify: function(aAccount) {
if (aAccount.imAccount.password && !aAccount.isAuthenticated) {
if (aAccount.imAccount.password && this.shouldAuthenticate &&
!aAccount.isAuthenticated) {
aAccount.sendMessage("IDENTIFY", aAccount.imAccount.password,
"IDENTIFY <password not logged>");
}
@ -104,7 +105,7 @@ var ircServices = {
// <command> :Unknown command
// IDENTIFY failed, try NICKSERV IDENTIFY.
if (aMessage.params[1] == "IDENTIFY" && this.imAccount.password &&
!this.isAuthenticated) {
this.shouldAuthenticate && !this.isAuthenticated) {
this.sendMessage("NICKSERV", ["IDENTIFY", this.imAccount.password],
"NICKSERV IDENTIFY <password not logged>");
return true;