diff --git a/components/membership.js b/components/membership.js index 36b3d73..f5ddde4 100644 --- a/components/membership.js +++ b/components/membership.js @@ -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` ${this.props.value} diff --git a/lib/irc.js b/lib/irc.js index dafa99b..708a614 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -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",