Bug 776901 - Land in comm-central Instantbird's changes to chat/ - 2 - Bio 1519 - /invite doesn't work, r=aleth.
This commit is contained in:
Родитель
e4ceb996ab
Коммит
b2af48e9f0
|
@ -102,6 +102,9 @@ message.parted.reason=: %S
|
|||
message.quit=%1$S has left the room (Quit%2$S).
|
||||
# The paramter is the quit message given by the user.
|
||||
message.quit2=: %S
|
||||
# %1$S is the nickname of the user that invited us, %2$S is the conversation
|
||||
# name.
|
||||
message.inviteReceived=%1$S has invited you to %2$S.
|
||||
# %1$S is the nickname of the invited user, %2$S is the conversation name
|
||||
# they were invited to.
|
||||
message.invited=%1$S was successfully invited to %2$S.
|
||||
|
|
|
@ -194,9 +194,14 @@ var ircBase = {
|
|||
return true;
|
||||
},
|
||||
"INVITE": function(aMessage) {
|
||||
// INVITE <nickname> <channel>
|
||||
// TODO prompt user to join channel.
|
||||
return false;
|
||||
// INVITE <nickname> <channel>
|
||||
// Auto-accept the invite.
|
||||
this.joinChat(this.getChatRoomDefaultFieldValues(aMessage.params[1]));
|
||||
this.getConversation(aMessage.params[1])
|
||||
.writeMessage(aMessage.params[0],
|
||||
_("message.inviteReceived", aMessage.params[0],
|
||||
aMessage.params[1]), {system: true});
|
||||
return true;
|
||||
},
|
||||
"JOIN": function(aMessage) {
|
||||
// JOIN ( <channel> *( "," <channel> ) [ <key> *( "," <key> ) ] ) / "0"
|
||||
|
@ -794,9 +799,13 @@ var ircBase = {
|
|||
*/
|
||||
"341": function(aMessage) { // RPL_INVITING
|
||||
// <channel> <nick>
|
||||
return serverMessage(this, aMessage,
|
||||
_("message.invited", aMessage.params[1],
|
||||
aMessage.params[0]));
|
||||
// Note that servers reply with parameters in the reverse order from the
|
||||
// above (which is as specified by RFC 2812).
|
||||
this.getConversation(aMessage.params[2])
|
||||
.writeMessage(aMessage.servername,
|
||||
_("message.invited", aMessage.params[1],
|
||||
aMessage.params[2]), {system: true});
|
||||
return true;
|
||||
},
|
||||
"342": function(aMessage) { // RPL_SUMMONING
|
||||
// <user> :Summoning user to IRC
|
||||
|
|
|
@ -152,7 +152,17 @@ var commands = [
|
|||
{
|
||||
name: "invite",
|
||||
get helpString() _("command.invite", "invite"),
|
||||
run: function(aMsg, aConv) simpleCommand(aConv, "INVITE", aMsg)
|
||||
run: function(aMsg, aConv) {
|
||||
let params = splitInput(aMsg);
|
||||
// If no parameters are given.
|
||||
if (!params[0].length)
|
||||
return false;
|
||||
// If only a nick is given, append the current channel name.
|
||||
if (params.length == 1)
|
||||
params.push(aConv.name);
|
||||
|
||||
return simpleCommand(aConv, "INVITE", params);
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "join",
|
||||
|
|
Загрузка…
Ссылка в новой задаче