"rejoin": "%text",
"set_setting": "ⓘ %text",
"list_aliases": "ⓘ %text",
- "ignored_pattern": "ⓘ %text"
+ "ignored_pattern": "ⓘ %text",
+ "wallops": "[WALLOPS] %text"
}
\ No newline at end of file
part: 'part', join: 'join', action: 'action', ctcp: 'ctcp',\r
ctcpRequest: 'ctcpRequest', ctcpResponse: 'ctcpResponse',\r
notice: 'notice', msg: 'privmsg', changeNick: 'changeNick',\r
- channelInfo: 'channelInfo', mode: 'mode'\r
+ channelInfo: 'channelInfo', mode: 'mode', wallops: 'wallops'\r
};\r
\r
// Proxy each gateway method\r
this.ctcp(connection_id, false, type, target, params, callback);\r
};\r
\r
+\r
/**\r
* @param {String} target The target of the message (e.g. a channel or nick)\r
* @param {String} msg The message to send\r
this.rpcCall('irc.encoding', connection_id, args, callback);\r
};\r
\r
+ /**\r
+ * Sends a Wallops message\r
+ * @param {String} target The target of the message\r
+ * @param {String} msg The message to send\r
+ * @param {Function} callback A callback function\r
+ */\r
+ this.wallops = function (connection_id, target, msg, callback) {\r
+ console.log(target);\r
+ var args = {\r
+ target: target,\r
+ msg: msg\r
+ };\r
+\r
+ this.rpcCall('irc.wallops', connection_id, args, callback);\r
+ };\r
+\r
\r
return new (Backbone.Model.extend(this))(arguments);\r
};\r
this.gateway.on('irc_error', onIrcError, this);
this.gateway.on('unknown_command', onUnknownCommand, this);
this.gateway.on('channel_info', onChannelInfo, this);
+ this.gateway.on('wallops', onWallops, this);
},
this.panels.server.addMsg('', styleText('unknown_command', {text: '[' + event.command + '] ' + display_params.join(', ', '')}));
}
+
+
+ function onWallops(event) {
+ var panel, active_panel;
+
+ panel = this.panels.server;
+
+ panel.addMsg('[' + (event.nick||'') + ']', styleText('wallops', {text: event.msg}), 'wallops', {time: event.time});
+
+ // Show wallops to the active panel if it's channel or query window
+ active_panel = _kiwi.app.panels().active;
+
+ if (active_panel !== panel) {
+ if (active_panel.isChannel() || active_panel.isQuery())
+ _kiwi.app.panels().active.addMsg('[' + (event.nick||'') + ']', styleText('wallops', {text: event.msg}), 'wallops', {time: event.time});
+ }
+ }
+
}
)();
},
RPL_WALLOPS: function (command) {
- this.irc_connection.emit('user ' + this.irc_connection.nick + ' notice', {
+ this.irc_connection.emit('user ' + this.irc_connection.nick + ' wallops', {
from_server: false,
- nick: 'WALLOPS: ' + command.nick,
+ nick: command.nick,
ident: command.ident,
hostname: command.hostname,
target: this.irc_connection.nick,
privmsg: onPrivmsg,\r
action: onAction,\r
ctcp_request: onCtcpRequest,\r
- mode: onMode\r
+ mode: onMode,\r
+ wallops: onWallops\r
};\r
EventBinder.bindIrcEvents('user ' + this.nick, this.irc_events, this, irc_connection);\r
};\r
time: event.time\r
});\r
}\r
+\r
+function onWallops(event) {\r
+ this.irc_connection.clientEvent('wallops', {\r
+ nick: event.nick,\r
+ ident: event.ident,\r
+ hostname: event.hostname,\r
+ target: event.target,\r
+ msg: event.msg,\r
+ time: event.time\r
+ });\r
+}\r