mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-14 19:25:26 -05:00
Add support for extended-join
This commit is contained in:
parent
010009e3e0
commit
11878aaaa9
3 changed files with 23 additions and 2 deletions
|
@ -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`
|
||||
|
|
|
@ -7,6 +7,7 @@ const permanentCaps = [
|
|||
"batch",
|
||||
"chghost",
|
||||
"echo-message",
|
||||
"extended-join",
|
||||
"invite-notify",
|
||||
"labeled-response",
|
||||
"message-tags",
|
||||
|
|
7
state.js
7
state.js
|
@ -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 };
|
||||
|
||||
|
|
Loading…
Reference in a new issue