forked from CringeStudios/gamja
lib/client: don't error out if SASL isn't available on RPL_WELCOME
Some servers (soju) might remove the sasl cap on connection registration.
This commit is contained in:
parent
723951a07b
commit
51bf8da3d6
@ -58,6 +58,7 @@ export default class Client extends EventTarget {
|
|||||||
status = Client.Status.DISCONNECTED;
|
status = Client.Status.DISCONNECTED;
|
||||||
serverPrefix = { name: "*" };
|
serverPrefix = { name: "*" };
|
||||||
nick = null;
|
nick = null;
|
||||||
|
supportsCap = false;
|
||||||
availableCaps = {};
|
availableCaps = {};
|
||||||
enabledCaps = {};
|
enabledCaps = {};
|
||||||
isupport = new Map();
|
isupport = new Map();
|
||||||
@ -234,7 +235,7 @@ export default class Client extends EventTarget {
|
|||||||
let k;
|
let k;
|
||||||
switch (msg.command) {
|
switch (msg.command) {
|
||||||
case irc.RPL_WELCOME:
|
case irc.RPL_WELCOME:
|
||||||
if (this.params.saslPlain && this.availableCaps["sasl"] === undefined) {
|
if (this.params.saslPlain && !this.supportsCap) {
|
||||||
this.dispatchEvent(new CustomEvent("error", { detail: "Server doesn't support SASL PLAIN" }));
|
this.dispatchEvent(new CustomEvent("error", { detail: "Server doesn't support SASL PLAIN" }));
|
||||||
this.disconnect();
|
this.disconnect();
|
||||||
return;
|
return;
|
||||||
@ -536,6 +537,7 @@ export default class Client extends EventTarget {
|
|||||||
let args = msg.params.slice(2);
|
let args = msg.params.slice(2);
|
||||||
switch (subCmd) {
|
switch (subCmd) {
|
||||||
case "LS":
|
case "LS":
|
||||||
|
this.supportsCap = true;
|
||||||
this.addAvailableCaps(args[args.length - 1]);
|
this.addAvailableCaps(args[args.length - 1]);
|
||||||
if (args[0] != "*") {
|
if (args[0] != "*") {
|
||||||
console.log("Available server caps:", this.availableCaps);
|
console.log("Available server caps:", this.availableCaps);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user