Handle casing differences between join commands and actual channel names
This commit is contained in:
parent
17e88b6e46
commit
42e8f2547d
|
@ -20,10 +20,10 @@
|
||||||
"gulp-gzip": "0.0.8"
|
"gulp-gzip": "0.0.8"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lodash": "3.0.0",
|
"lodash": "3.2.0",
|
||||||
"reflux": "0.2.4",
|
"reflux": "0.2.5",
|
||||||
"react-router": "~0.11.6",
|
"react-router": "0.12.0",
|
||||||
"react": "~0.12.2",
|
"react": "0.12.2",
|
||||||
"react-infinite": "~0.2.2"
|
"react-infinite": "0.2.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -18,6 +18,7 @@ var selectedTabStore = Reflux.createStore({
|
||||||
this.listenToMany(actions);
|
this.listenToMany(actions);
|
||||||
this.listenTo(channelActions.part, 'part');
|
this.listenTo(channelActions.part, 'part');
|
||||||
this.listenTo(serverActions.disconnect, 'disconnect');
|
this.listenTo(serverActions.disconnect, 'disconnect');
|
||||||
|
this.listenTo(channelActions.addUser, 'userAdded');
|
||||||
this.listenTo(channelActions.load, 'loadChannels');
|
this.listenTo(channelActions.load, 'loadChannels');
|
||||||
this.listenTo(serverActions.load, 'loadServers');
|
this.listenTo(serverActions.load, 'loadServers');
|
||||||
},
|
},
|
||||||
|
@ -51,6 +52,17 @@ var selectedTabStore = Reflux.createStore({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
userAdded: function(user, server, channel) {
|
||||||
|
// Update the selected channel incase the casing is different
|
||||||
|
if (server === selectedTab.server &&
|
||||||
|
channel.toLowerCase() === selectedTab.channel.toLowerCase() &&
|
||||||
|
user === serverStore.getNick(server)) {
|
||||||
|
selectedTab.channel = channel;
|
||||||
|
selectedTab.name = channel;
|
||||||
|
this.trigger(selectedTab);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
loadChannels: function(channels) {
|
loadChannels: function(channels) {
|
||||||
if (selectedTab.channel && !_.find(channels, { name: selectedTab.channel })) {
|
if (selectedTab.channel && !_.find(channels, { name: selectedTab.channel })) {
|
||||||
selectedTab.channel = null;
|
selectedTab.channel = null;
|
||||||
|
|
Loading…
Reference in New Issue