-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Fix implementation of stream notifications without Rocketbot #4016
Comments
Worth noting that notifications do not persist in the room, because they're added directly to the client stream, not the server. They look like messages and have all the UI controls of a normal message, but don't act like messages. They don't need a user icon or time stamp or message controls. It's a subtle but confusing user experience, they should probably be replaced altogether by a more appropriately designed component. |
FWIW, I went overboard with the detail because I intend to come back here one day and submit a fix. |
Discuss further on #10456 |
0.37.0
Related #3869
Notifications are pretty weird, if I understand correctly...
Notifications.notifyUser
(with second param as 'message') emits a notification message event directed at a user (usually the current user). It accepts the message object (usually defined with a random user ID, with a localized string as the message content).Then RoomManager watches for
RocketChat.Notifications.onUser
event and inserts a new message into the stream, used to give feedback to user within the current channel, without actually adding that message to the channel (as it shouldn't appear to all).The message has the username attribute assigned as 'rocketbot' before its inserted into the stream.
This method is used for various message error notices e.g. User submits message when muted or tries to mention
@all
but doesn't havemention-all
permission.Problems:
rocketbot
as username. e.g. chatMessages.coffeeNo_such_command
error.rocketbot
name it brings up a user panel, but it's not a real user, so none of the controls work. You get 400 errors if you try to click them. e.g. Try muting rocketbot. Notifications should be rendered differently, so the name is not clickable or relate to normal user functions.The text was updated successfully, but these errors were encountered: