mirror of
https://codeberg.org/emersion/gamja
synced 2025-04-22 01:23:56 +02:00
lib/irc: move over STD_MEMBERSHIP_NAMES
This commit is contained in:
parent
9bcfd088c2
commit
301f133272
@ -1,21 +1,13 @@
|
|||||||
import { html, Component } from "../lib/index.js";
|
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) {
|
export default function Membership(props) {
|
||||||
if (!this.props.value) {
|
if (!this.props.value) {
|
||||||
return null;
|
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`
|
return html`
|
||||||
<span class="membership ${name}" title=${name}>
|
<span class="membership ${name}" title=${name}>
|
||||||
${this.props.value}
|
${this.props.value}
|
||||||
|
@ -77,6 +77,14 @@ export const ERR_SASLALREADY = "907";
|
|||||||
export const STD_MEMBERSHIPS = "~&@%+";
|
export const STD_MEMBERSHIPS = "~&@%+";
|
||||||
export const STD_CHANTYPES = "#&+!";
|
export const STD_CHANTYPES = "#&+!";
|
||||||
|
|
||||||
|
export const STD_MEMBERSHIP_NAMES = {
|
||||||
|
"~": "owner",
|
||||||
|
"&": "admin",
|
||||||
|
"@": "operator",
|
||||||
|
"%": "halfop",
|
||||||
|
"+": "voice",
|
||||||
|
};
|
||||||
|
|
||||||
const tagEscapeMap = {
|
const tagEscapeMap = {
|
||||||
";": "\\:",
|
";": "\\:",
|
||||||
" ": "\\s",
|
" ": "\\s",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user