forked from CringeStudios/gamja
lib/irc: add missing Isupport.chanModes
It was called by forEachChannelModeUpdate, but wasn't implemented.
This commit is contained in:
parent
393fd93253
commit
bd48f36ade
17
lib/irc.js
17
lib/irc.js
@ -73,7 +73,6 @@ export const ERR_SASLALREADY = "907";
|
|||||||
|
|
||||||
export const STD_MEMBERSHIPS = "~&@%+";
|
export const STD_MEMBERSHIPS = "~&@%+";
|
||||||
export const STD_CHANTYPES = "#&+!";
|
export const STD_CHANTYPES = "#&+!";
|
||||||
export const STD_CHANMODES = "beI,k,l,imnst";
|
|
||||||
|
|
||||||
const tagEscapeMap = {
|
const tagEscapeMap = {
|
||||||
";": "\\:",
|
";": "\\:",
|
||||||
@ -464,6 +463,19 @@ export class Isupport {
|
|||||||
bouncerNetID() {
|
bouncerNetID() {
|
||||||
return this.raw.get("BOUNCER_NETID");
|
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 = {
|
export const CaseMapping = {
|
||||||
@ -672,11 +684,10 @@ export function getMessageLabel(msg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function forEachChannelModeUpdate(msg, isupport, callback) {
|
export function forEachChannelModeUpdate(msg, isupport, callback) {
|
||||||
let chanmodes = isupport.chanModes();
|
let [a, b, c, d] = isupport.chanModes();
|
||||||
let prefix = isupport.prefix();
|
let prefix = isupport.prefix();
|
||||||
|
|
||||||
let typeByMode = new Map();
|
let typeByMode = new Map();
|
||||||
let [a, b, c, d] = chanmodes.split(",");
|
|
||||||
Array.from(a).forEach((mode) => typeByMode.set(mode, "A"));
|
Array.from(a).forEach((mode) => typeByMode.set(mode, "A"));
|
||||||
Array.from(b).forEach((mode) => typeByMode.set(mode, "B"));
|
Array.from(b).forEach((mode) => typeByMode.set(mode, "B"));
|
||||||
Array.from(c).forEach((mode) => typeByMode.set(mode, "C"));
|
Array.from(c).forEach((mode) => typeByMode.set(mode, "C"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user