});\r
\r
\r
+ gw.on('onaction', function (event) {\r
+ var panel,\r
+ is_pm = (event.channel == kiwi.gateway.get('nick'));\r
+\r
+ if (is_pm) {\r
+ // If a panel isn't found for this PM, create one\r
+ panel = that.panels.getByName(event.nick);\r
+ if (!panel) {\r
+ panel = new kiwi.model.Channel({name: event.nick});\r
+ that.panels.add(panel);\r
+ }\r
+\r
+ } else {\r
+ // If a panel isn't found for this channel, reroute to the\r
+ // server panel\r
+ panel = that.panels.getByName(event.channel);\r
+ if (!panel) {\r
+ panel = that.panels.server;\r
+ }\r
+ }\r
+\r
+ panel.addMsg('', '* ' + event.nick + ' ' + event.msg, 'action');\r
+ });\r
+\r
+\r
gw.on('ontopic', function (event) {\r
var c;\r
c = that.panels.getByName(event.channel);\r
controlbox.on('command', this.allCommands);\r
controlbox.on('command_msg', this.msgCommand);\r
\r
+ controlbox.on('command_action', this.actionCommand);\r
+ controlbox.on('command_me', this.actionCommand);\r
+\r
controlbox.on('command_join', this.joinCommand);\r
controlbox.on('command_j', this.joinCommand);\r
\r
kiwi.gateway.privmsg(destination, ev.params.join(' '));\r
};\r
\r
+ this.actionCommand = function (ev) {\r
+ if (kiwi.current_panel === kiwi.app.panels.server) {\r
+ return;\r
+ }\r
+\r
+ var panel = kiwi.current_panel;\r
+ panel.addMsg('', '* ' + kiwi.gateway.get('nick') + ' ' + ev.params.join(' '), 'action');\r
+ kiwi.gateway.action(panel.get('name'), ev.params.join(' '));\r
+ };\r
+\r
this.partCommand = function (ev) {\r
if (ev.params.length === 0) {\r
kiwi.gateway.part(kiwi.current_panel.get('name'));\r