Fix WHOIS DB not using case-mapping fallback

In case the server advertises an unsupported case-mapping, we have
a fallback.
This commit is contained in:
Simon Ser 2021-05-28 09:59:51 +02:00
parent 7b762b3e8a
commit 5a3edf4769

View file

@ -436,11 +436,12 @@ export default class Client extends EventTarget {
setCaseMapping(name) {
this.cm = irc.CaseMapping.byName(name);
this.whoisDB = new irc.CaseMapMap(this.whoisDB, this.cm);
if (!this.cm) {
console.error("Unsupported case-mapping '" + name + "', falling back to RFC 1459");
this.cm = irc.CaseMapping.RFC1459;
}
this.whoisDB = new irc.CaseMapMap(this.whoisDB, this.cm);
}
isMyNick(nick) {