gamja/state.js
2020-06-29 11:08:47 +02:00

26 lines
452 B
JavaScript

export const BufferType = {
SERVER: "server",
CHANNEL: "channel",
NICK: "nick",
};
export const Status = {
DISCONNECTED: "disconnected",
CONNECTING: "connecting",
REGISTERED: "registered",
};
export const Unread = {
NONE: "",
MESSAGE: "message",
HIGHLIGHT: "highlight",
union: (a, b) => {
const priority = {
[Unread.None]: 0,
[Unread.MESSAGE]: 1,
[Unread.HIGHLIGHT]: 2,
};
return (priority[a] > priority[b]) ? a : b;
},
};