Parse ISUPPORT tokens in client

This commit is contained in:
Simon Ser 2021-05-11 16:03:16 +02:00
parent e242d5222e
commit 305ffb569c
2 changed files with 7 additions and 4 deletions

View file

@ -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:

View file

@ -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;