Skip to content
Snippets Groups Projects
Commit 2e735943 authored by echicken's avatar echicken :chicken:
Browse files

Event emitter for mail (just unread mail count for now)

parent e1d9deee
No related branches found
No related tags found
No related merge requests found
load(settings.web_lib + 'forum.js');
var last_run = 0;
var frequency = 10;
function cycle() {
if (user.number < 1 || user.alias == settings.guest) return;
if (time() - last_run <= frequency) return;
last_run = time();
const count = user.stats.mail_waiting;
if (count > 0) emit({ event: 'mail', data: JSON.stringify({ count: count })});
}
this;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment