mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
Add and use util.is_current_user helper function.
Previously, we were checking if a particular user was the current user in dozens of places in the codebase, and correct case-insensitive checks were not used consistently, leading to bugs like #502.
This commit is contained in:
@@ -61,6 +61,10 @@ exports.same_stream_and_subject = function util_same_stream_and_subject(a, b) {
|
||||
(a.subject.toLowerCase() === b.subject.toLowerCase()));
|
||||
};
|
||||
|
||||
exports.is_current_user = function (email) {
|
||||
return email.toLowerCase() === page_params.email.toLowerCase();
|
||||
};
|
||||
|
||||
exports.same_major_recipient = function (a, b) {
|
||||
// Same behavior as same_recipient, except that it returns true for messages
|
||||
// on different topics but the same stream.
|
||||
|
||||
Reference in New Issue
Block a user