-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instant notifications #53
base: main
Are you sure you want to change the base?
Conversation
Send an event when a notification is added
Rad. This is rad. Thanks. |
I am testing this right now and it is mind boggling how fast it is. I will have to implement this for the DM interface too ;p |
ah, one small bug - if there are unread messages already waiting, they won't show up til the first new incoming. the first request should always return current status. |
Also, not sure the impact of this - but the server-side listener continues to exist even if i navigate away from the page. |
I think that fixes both issues |
Ignore self-DMs, remove tools (boost, like, edit) on notifications
…ate unread counter
…ould give up and the user would get no more notifications
The last few commits on here raise eyebrows - I don't really want to fire notifications for every single incoming post or dm. This will create a lot of noise in the notifications that has to be filtered out. Instead, you could directly trigger the "check for notifications" event from those places, which would cause the longpoll to do the actual calculations... |
… UserEvent directly - causing the long poll to end and the messages counts to be read.
Added an eventemitter to notify /poll that a notification has occurred.
/poll now stalls forever waiting for an event (once an event occurs, app.js repolls after 1s)
Adding a notification sends the event