Mark buffers as unread on new message

This commit is contained in:
Simon Ser 2020-06-24 16:56:28 +02:00
parent 9ff1f164e0
commit cbe76ab824
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
4 changed files with 64 additions and 23 deletions

20
state.js Normal file
View file

@ -0,0 +1,20 @@
export const SERVER_BUFFER = "*";
export const Status = {
DISCONNECTED: "disconnected",
CONNECTING: "connecting",
REGISTERED: "registered",
};
export const Unread = {
NONE: "",
MESSAGE: "message",
union: (a, b) => {
const priority = {
[Unread.None]: 0,
[Unread.MESSAGE]: 1,
};
return (priority[a] > priority[b]) ? a : b;
},
};