Add support for extended-join

This commit is contained in:
Simon Ser 2021-09-21 14:29:31 +02:00
parent 010009e3e0
commit 11878aaaa9
3 changed files with 23 additions and 2 deletions

View file

@ -1,5 +1,6 @@
import { html, Component } from "../lib/index.js";
import { getNickURL } from "../state.js";
import { strip as stripANSI } from "../lib/ansi.js";
import Membership from "./membership.js";
class MemberItem extends Component {
@ -41,8 +42,20 @@ class MemberItem extends Component {
let title = null;
let user = this.props.user;
if (user && user.username && user.hostname) {
title = `${user.username}@${user.hostname}`;
if (user) {
let mask = "";
if (user.username && user.hostname) {
mask = `${user.username}@${user.hostname}`;
}
if (user.realname) {
title = stripANSI(user.realname);
if (mask) {
title = `${title} (${mask})`;
}
} else {
title = mask;
}
}
return html`

View file

@ -7,6 +7,7 @@ const permanentCaps = [
"batch",
"chghost",
"echo-message",
"extended-join",
"invite-notify",
"labeled-response",
"message-tags",

View file

@ -410,6 +410,13 @@ export const State = {
if (msg.prefix.host) {
who.hostname = msg.prefix.host;
}
if (msg.params.length > 2) {
who.account = msg.params[1];
if (who.account === "*") {
who.account = null;
}
who.realname = msg.params[2];
}
update = updateUser(msg.prefix.name, who);
state = { ...state, ...update };