mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
Remove redundant checks that messages were sent by user.
When a user sends a message, it should be considered to be "read" by that same user, but all that logic is handled on the back end now, so we can remove some of the front end code related to saying that a message is unread. (imported from commit e4263f86c666882db42d7ae3d399196803d700cd)
This commit is contained in:
@@ -206,27 +206,23 @@ exports.received_messages = function (messages) {
|
||||
var i;
|
||||
|
||||
$.each(messages, function (index, message) {
|
||||
if (message.sender_email !== page_params.email &&
|
||||
narrow.message_in_home(message)) {
|
||||
|
||||
// We send notifications for messages which the user has
|
||||
// configured as notifiable, as long as they haven't been
|
||||
// marked as read by process_visible_unread_messages
|
||||
// (which occurs if the message arrived onscreen while the
|
||||
// window had focus).
|
||||
if (!(message_is_notifiable(message) && unread.message_unread(message))) {
|
||||
return;
|
||||
}
|
||||
if (page_params.desktop_notifications_enabled &&
|
||||
browser_desktop_notifications_on()) {
|
||||
process_desktop_notification(message);
|
||||
}
|
||||
if (page_params.sounds_enabled && supports_sound) {
|
||||
if (window.bridge !== undefined) {
|
||||
window.bridge.bell();
|
||||
} else {
|
||||
$("#notifications-area").find("audio")[0].play();
|
||||
}
|
||||
// We send notifications for messages which the user has
|
||||
// configured as notifiable, as long as they haven't been
|
||||
// marked as read by process_visible_unread_messages
|
||||
// (which occurs if the message arrived onscreen while the
|
||||
// window had focus).
|
||||
if (!(message_is_notifiable(message) && unread.message_unread(message))) {
|
||||
return;
|
||||
}
|
||||
if (page_params.desktop_notifications_enabled &&
|
||||
browser_desktop_notifications_on()) {
|
||||
process_desktop_notification(message);
|
||||
}
|
||||
if (page_params.sounds_enabled && supports_sound) {
|
||||
if (window.bridge !== undefined) {
|
||||
window.bridge.bell();
|
||||
} else {
|
||||
$("#notifications-area").find("audio")[0].play();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user