mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-14 19:25:26 -05:00
lib/irc: add missing Isupport.chanModes
It was called by forEachChannelModeUpdate, but wasn't implemented.
This commit is contained in:
parent
393fd93253
commit
bd48f36ade
1 changed files with 14 additions and 3 deletions
17
lib/irc.js
17
lib/irc.js
|
@ -73,7 +73,6 @@ export const ERR_SASLALREADY = "907";
|
|||
|
||||
export const STD_MEMBERSHIPS = "~&@%+";
|
||||
export const STD_CHANTYPES = "#&+!";
|
||||
export const STD_CHANMODES = "beI,k,l,imnst";
|
||||
|
||||
const tagEscapeMap = {
|
||||
";": "\\:",
|
||||
|
@ -464,6 +463,19 @@ export class Isupport {
|
|||
bouncerNetID() {
|
||||
return this.raw.get("BOUNCER_NETID");
|
||||
}
|
||||
|
||||
chanModes() {
|
||||
const stdChanModes = ["beI", "k", "l", "imnst"];
|
||||
if (!this.raw.has("CHANMODES")) {
|
||||
return stdChanModes;
|
||||
}
|
||||
let chanModes = this.raw.get("CHANMODES").split(",");
|
||||
if (chanModes.length != 4) {
|
||||
console.error("Invalid CHANMODES: ", this.raw.get("CHANMODES"));
|
||||
return stdChanModes;
|
||||
}
|
||||
return chanModes;
|
||||
}
|
||||
}
|
||||
|
||||
export const CaseMapping = {
|
||||
|
@ -672,11 +684,10 @@ export function getMessageLabel(msg) {
|
|||
}
|
||||
|
||||
export function forEachChannelModeUpdate(msg, isupport, callback) {
|
||||
let chanmodes = isupport.chanModes();
|
||||
let [a, b, c, d] = isupport.chanModes();
|
||||
let prefix = isupport.prefix();
|
||||
|
||||
let typeByMode = new Map();
|
||||
let [a, b, c, d] = chanmodes.split(",");
|
||||
Array.from(a).forEach((mode) => typeByMode.set(mode, "A"));
|
||||
Array.from(b).forEach((mode) => typeByMode.set(mode, "B"));
|
||||
Array.from(c).forEach((mode) => typeByMode.set(mode, "C"));
|
||||
|
|
Loading…
Reference in a new issue