Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

Commit

Permalink
Attempting to resolve the issue in #21
Browse files Browse the repository at this point in the history
  • Loading branch information
rickihastings committed Mar 4, 2014
1 parent 19e9940 commit 32897f6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,16 @@ RPCHandler.prototype.handleInsertTab = function(socket, data) {

var nid = new mongo.ObjectID(data.network),
ircClient = Clients[nid];
data.target = decodeURIComponent(data.target);

if (ircClient && ircClient.internal.userId.toString() === user._id.toString()) {
var type = (helper.isChannel(ircClient, data.target)) ? 'channel' : 'query';
networkManager.addTab(ircClient, data.target, type, data.selected);

if (type === 'channel') {
ircFactory.send(ircClient._id, 'join', [data.target]);
} else {
networkManager.addTab(ircClient, data.target, type, data.selected);
}
}
// we're allowed to continue, use network manager to add the tab
}
Expand Down

0 comments on commit 32897f6

Please sign in to comment.