mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
markdown: Use early-exit code style for mentions.
This commit is contained in:
@@ -115,7 +115,18 @@ exports.apply_markdown = function (message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (person !== undefined) {
|
if (!person) {
|
||||||
|
// This is nothing to be concerned about--the users
|
||||||
|
// are allowed to hand-type mentions and they may
|
||||||
|
// have had a typo in the name.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// HAPPY PATH! Note that we not only need to return the
|
||||||
|
// appropriate HTML snippet here; we also want to update
|
||||||
|
// flags on the message itself that get used by the message
|
||||||
|
// view code and possibly our filtering code.
|
||||||
|
|
||||||
if (people.my_current_user_id() === person.user_id && !silently) {
|
if (people.my_current_user_id() === person.user_id && !silently) {
|
||||||
message.mentioned = true;
|
message.mentioned = true;
|
||||||
message.mentioned_me_directly = true;
|
message.mentioned_me_directly = true;
|
||||||
@@ -127,8 +138,6 @@ exports.apply_markdown = function (message) {
|
|||||||
str += '<span class="user-mention" data-user-id="' + person.user_id + '">@';
|
str += '<span class="user-mention" data-user-id="' + person.user_id + '">@';
|
||||||
}
|
}
|
||||||
return str + _.escape(person.full_name) + '</span>';
|
return str + _.escape(person.full_name) + '</span>';
|
||||||
}
|
|
||||||
return;
|
|
||||||
},
|
},
|
||||||
groupMentionHandler: function (name) {
|
groupMentionHandler: function (name) {
|
||||||
const group = user_groups.get_user_group_from_name(name);
|
const group = user_groups.get_user_group_from_name(name);
|
||||||
|
|||||||
Reference in New Issue
Block a user