diff --git a/components/app.js b/components/app.js index 766ab0b..ce8ab24 100644 --- a/components/app.js +++ b/components/app.js @@ -514,11 +514,8 @@ export default class App extends Component { this.setBufferState({ network: netID, name: SERVER_BUFFER }, { serverInfo }); break; case irc.RPL_ISUPPORT: - var tokens = msg.params.slice(1, -1); this.setNetworkState(netID, (network) => { - var isupport = new Map(network.isupport); - irc.parseISUPPORT(tokens, isupport); - return { isupport }; + return { isupport: new Map(client.isupport) }; }); break; case irc.RPL_NOTOPIC: diff --git a/lib/client.js b/lib/client.js index 3ed2e6b..8eb6073 100644 --- a/lib/client.js +++ b/lib/client.js @@ -28,6 +28,7 @@ export default class Client extends EventTarget { nick = null; availableCaps = {}; enabledCaps = {}; + isupport = new Map(); ws = null; params = { @@ -82,6 +83,7 @@ export default class Client extends EventTarget { this.enabledCaps = {}; this.batches = new Map(); this.pendingHistory = Promise.resolve(null); + this.isupport = new Map(); if (this.autoReconnect) { console.info("Reconnecting to server in " + RECONNECT_DELAY_SEC + " seconds"); @@ -158,6 +160,10 @@ export default class Client extends EventTarget { this.setStatus(Client.Status.REGISTERED); this.serverPrefix = msg.prefix; break; + case irc.RPL_ISUPPORT: + var tokens = msg.params.slice(1, -1); + irc.parseISUPPORT(tokens, this.isupport); + break; case "CAP": this.handleCap(msg); break;