Channel Info+admin window; RPL_CHANNEL_URL; Ban list; CSS forms refactor
[KiwiIRC.git] / client / src / models / application.js
index 05a282b602cbc18922fa833c00139dd9029b319a..80a2a85cc62d30a06e10c46366682f8815020469 100644 (file)
@@ -458,6 +458,8 @@ _kiwi.model.Application = function () {
                         that.message.text(msg, {timeout: 8000});\r
 \r
                         setTimeout(function forcedReconnectPartTwo() {\r
+                            _kiwi.gateway.set('kiwi_server', _kiwi.app.kiwi_server);\r
+\r
                             _kiwi.gateway.reconnect(function() {\r
                                 // Reconnect all the IRC connections\r
                                 that.connections.forEach(function(con){ con.reconnect(); });\r
@@ -493,6 +495,8 @@ _kiwi.model.Application = function () {
                 '/voice': '/quote mode $channel +v $1+',\r
                 '/devoice': '/quote mode $channel -v $1+',\r
                 '/k': '/kick $channel $1+',\r
+                '/ban': '/quote mode $channel +b $1+',\r
+                '/unban': '/quote mode $channel -b $1+',\r
 \r
                 // Misc aliases\r
                 '/slap': '/me slaps $1 around a bit with a large trout'\r
@@ -537,6 +541,15 @@ _kiwi.model.Application = function () {
 \r
             controlbox.on('command:encoding', encodingCommand);\r
 \r
+            controlbox.on('command:info', function(ev) {\r
+                var active_panel = _kiwi.app.panels().active;\r
+\r
+                if (!active_panel.isChannel())\r
+                    return;\r
+\r
+                new _kiwi.model.ChannelInfo({channel: _kiwi.app.panels().active});\r
+            });\r
+\r
             controlbox.on('command:css', function (ev) {\r
                 var queryString = '?reload=' + new Date().getTime();\r
                 $('link[rel="stylesheet"]').each(function () {\r
@@ -711,13 +724,15 @@ _kiwi.model.Application = function () {
         }\r
 \r
         function msgCommand (ev) {\r
-            var destination = ev.params[0],\r
+            var message,\r
+                destination = ev.params[0],\r
                 panel = that.connections.active_connection.panels.getByName(destination) || that.panels().server;\r
 \r
             ev.params.shift();\r
+            message = formatToIrcMsg(ev.params.join(' '));\r
 \r
-            panel.addMsg(_kiwi.app.connections.active_connection.get('nick'), ev.params.join(' '));\r
-            _kiwi.gateway.privmsg(null, destination, ev.params.join(' '));\r
+            panel.addMsg(_kiwi.app.connections.active_connection.get('nick'), message);\r
+            _kiwi.gateway.privmsg(null, destination, message);\r
         }\r
 \r
         function actionCommand (ev) {\r