mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 12:21:58 +00:00
refactor: Extract compose.reply_with_mention().
This commit is contained in:
@@ -636,6 +636,13 @@ exports.respond_to_message = function (opts) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.reply_with_mention = function (opts) {
|
||||||
|
exports.respond_to_message(opts);
|
||||||
|
var message = current_msg_list.selected_message();
|
||||||
|
var mention = '@**' + message.sender_full_name + '**';
|
||||||
|
$('#new_message_content').val(mention + ' ');
|
||||||
|
};
|
||||||
|
|
||||||
// This function is for debugging / data collection only. Arguably it
|
// This function is for debugging / data collection only. Arguably it
|
||||||
// should live in debug.js, but then it wouldn't be able to call
|
// should live in debug.js, but then it wouldn't be able to call
|
||||||
// send_message() directly below.
|
// send_message() directly below.
|
||||||
|
|||||||
@@ -477,9 +477,7 @@ exports.process_hotkey = function (e) {
|
|||||||
compose.respond_to_message({reply_type: "personal", trigger: 'hotkey pm'});
|
compose.respond_to_message({reply_type: "personal", trigger: 'hotkey pm'});
|
||||||
return true;
|
return true;
|
||||||
case 'compose_reply_with_mention': // '@': respond to message with mention to author
|
case 'compose_reply_with_mention': // '@': respond to message with mention to author
|
||||||
compose.respond_to_message({trigger: 'hotkey'});
|
compose.reply_with_mention({trigger: 'hotkey'});
|
||||||
var message = current_msg_list.selected_message();
|
|
||||||
$("#new_message_content").val('@**' + message.sender_full_name + '** ');
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user