var gw_stat = 0;\r
\r
gw.on('disconnect', function (event) {\r
- that.message.text('You have been disconnected. Attempting to reconnect..');\r
+ var msg = 'You have been disconnected. Attempting to reconnect for you..';\r
+ that.message.text(msg, {timeout: 10000});\r
+\r
+ // Mention the disconnection on every channel\r
+ $.each(kiwi.app.panels.models, function (idx, panel) {\r
+ console.log(arguments);\r
+ if (!panel || !panel.isChannel()) return;\r
+ panel.addMsg('', msg, 'action quit');\r
+ });\r
+ kiwi.app.panels.server.addMsg('', msg, 'action quit');\r
+\r
gw_stat = 1;\r
});\r
gw.on('reconnecting', function (event) {\r
- that.message.text('You have been disconnected. Attempting to reconnect again in ' + (event.delay/1000) + ' seconds..');\r
+ msg = 'You have been disconnected. Attempting to reconnect again in ' + (event.delay/1000) + ' seconds..';\r
+ kiwi.app.panels.server.addMsg('', msg, 'action quit');\r
});\r
gw.on('connect', function (event) {\r
if (gw_stat !== 1) return;\r
\r
- that.message.text('It\'s OK, you\'re connected again :)', {timeout: 5000});\r
+ var msg = 'It\'s OK, you\'re connected again :)';\r
+ that.message.text(msg, {timeout: 5000});\r
+\r
+ // Mention the disconnection on every channel\r
+ $.each(kiwi.app.panels.models, function (idx, panel) {\r
+ if (!panel || !panel.isChannel()) return;\r
+ panel.addMsg('', msg, 'action join');\r
+ });\r
+ kiwi.app.panels.server.addMsg('', msg, 'action join');\r
+\r
gw_stat = 0;\r
});\r
})();\r