mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +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:
@@ -35,20 +35,9 @@ function unread_hashkey(message) {
|
||||
}
|
||||
|
||||
exports.message_unread = function (message) {
|
||||
// This is the only halfway interesting function in this module.
|
||||
// Everything else is just slinging hashes around.
|
||||
|
||||
if (message === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var sent_by_human = ['website', 'iphone', 'android']
|
||||
.indexOf(message.client.toLowerCase()) !== -1;
|
||||
|
||||
if (message.sender_email === page_params.email && sent_by_human) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return message.flags === undefined ||
|
||||
message.flags.indexOf('read') === -1;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user