WALLOPS should only show in channel/query panels for the current network
authorDarren <darren@darrenwhitlen.com>
Fri, 23 May 2014 13:48:52 +0000 (14:48 +0100)
committerDarren <darren@darrenwhitlen.com>
Fri, 23 May 2014 13:48:52 +0000 (14:48 +0100)
client/src/models/network.js

index 1f351aea4e711d311d92fa46ab46d9de567a62fb..e3d4d782c227eda70d9733b1ad38adbea93e13e9 100644 (file)
 
 
     function onWallops(event) {
+        var active_panel = _kiwi.app.panels().active;
+
         // Send to server panel
         this.panels.server.addMsg('[' + (event.nick||'') + ']', styleText('wallops', {text: event.msg}), 'wallops', {time: event.time});
-        // Send to active panel
-        if (_kiwi.app.panels().active !== this.panels.server) 
-            _kiwi.app.panels().active.addMsg('[' + (event.nick||'') + ']', styleText('wallops', {text: event.msg}), 'wallops', {time: event.time});
+
+        // Send to active panel if its a channel/query *and* it's related to this network
+        if (active_panel !== this.panels.server && (active_panel.isChannel() || active_panel.isQuery()) && active_panel.get('network') === this)
+            active_panel.addMsg('[' + (event.nick||'') + ']', styleText('wallops', {text: event.msg}), 'wallops', {time: event.time});
     }
 
 }