-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
More consistent HTML notifications and sounds #1116
Conversation
- HTML notifications are shown when the user has selected the room of the message but the chat window does not have the focus. - HTML notification and new message sound use the same condition. - The unread count is always updated if the chat window does not have the focus.
Thanks for your contribution, it's very much appreciated! Will test here but I suggest more people to jump in. |
I'm not sure this is working as expected, specially for Direct Messages. If my browser window is not active and I receive a new DM I just don't get any kind of notification I could be aware (i.e. only icon badge, which is currently hidden). |
Hm, it works for me. I tested on OS X with Chrome, Firefox and Safari. What browser do you use? When you expected a notification but didn't get one, did you get a sound? Is it consistently not working or only intermittently? I've once had no notifications at all in Safari, but when I restarted my local Rocket-Chat server and opened the Safari devtools to investigate, the notifications suddenly worked. Also some coworkers told me that desktop notifications weren't working for them at all using our local Rocket-Chat server running the vanilla version, i.e. without my modifications. I haven't had the time to investigate this yet but maybe there are some circumstances which make notifications fail that are independent from my changes. |
I might had something wrong here, my bad, it do work :) 👍 LGTM, any other reviews @RocketChat/owners ? |
@@ -116,9 +119,20 @@ RocketChat.sendMessage = (user, message, room, options) -> | |||
query._id = | |||
$in: mentionIds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that this query
isn't used anymore
Push notifications are now sent to offline users of the room as well. |
@teetrinkers looks very nice 😃 |
More consistent HTML notifications and sounds
First steps for #1068.
There is some duplicate code in /client/startup/unread.coffee (unread count) and /client/notifications/notification.coffee (notifications) for finding out whether the user has immediately read the new message. This could possibly be unified, but I need to get a better feel of the code first, I think.