mirror of
https://codeberg.org/emersion/gamja.git
synced 2025-02-16 02:59:44 -05:00
lib/irc: move over STD_MEMBERSHIP_NAMES
This commit is contained in:
parent
9bcfd088c2
commit
301f133272
2 changed files with 11 additions and 11 deletions
|
@ -1,21 +1,13 @@
|
|||
import { html, Component } from "../lib/index.js";
|
||||
|
||||
// XXX: If we were feeling creative we could generate unique colors for
|
||||
// each item in ISUPPORT CHANMODES. But I am not feeling creative.
|
||||
const names = {
|
||||
"~": "owner",
|
||||
"&": "admin",
|
||||
"@": "op",
|
||||
"%": "halfop",
|
||||
"+": "voice",
|
||||
};
|
||||
|
||||
export default function Membership(props) {
|
||||
if (!this.props.value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const name = names[this.props.value[0]] || "";
|
||||
// XXX: If we were feeling creative we could generate unique colors for
|
||||
// each item in ISUPPORT CHANMODES. But I am not feeling creative.
|
||||
const name = irc.STD_MEMBERSHIP_NAMES[this.props.value[0]] || "";
|
||||
return html`
|
||||
<span class="membership ${name}" title=${name}>
|
||||
${this.props.value}
|
||||
|
|
|
@ -77,6 +77,14 @@ export const ERR_SASLALREADY = "907";
|
|||
export const STD_MEMBERSHIPS = "~&@%+";
|
||||
export const STD_CHANTYPES = "#&+!";
|
||||
|
||||
export const STD_MEMBERSHIP_NAMES = {
|
||||
"~": "owner",
|
||||
"&": "admin",
|
||||
"@": "operator",
|
||||
"%": "halfop",
|
||||
"+": "voice",
|
||||
};
|
||||
|
||||
const tagEscapeMap = {
|
||||
";": "\\:",
|
||||
" ": "\\s",
|
||||
|
|
Loading…
Reference in a new issue