Refactor ISUPPORT handling

Add a helper class to parse ISUPPORT tokens. Instead of having
manual ISUPPORT handling all over the place, use pre-processed
values.
This commit is contained in:
Simon Ser 2021-12-07 12:09:10 +01:00
parent 31b293fa03
commit ab3d4dd661
7 changed files with 128 additions and 84 deletions

View file

@ -87,7 +87,7 @@ export default function BufferHeader(props) {
`;
if (props.isBouncer) {
if (props.server.isupport.get("BOUNCER_NETID")) {
if (props.server.bouncerNetID) {
if (fullyConnected) {
actions.push(joinButton);
}
@ -186,7 +186,7 @@ export default function BufferHeader(props) {
item = `authenticated as ${props.user.account}`;
}
details.push(html`<abbr title=${desc}>${item}</abbr>`);
} else if (props.server.isupport.has("MONITOR") && props.server.isupport.has("WHOX")) {
} else if (props.server.reliableUserAccounts) {
// If the server supports MONITOR and WHOX, we can faithfully
// keep user.account up-to-date for user queries
let desc = "This user has not been verified and is not logged in.";