hotkey: Remap + key to use canonical name for thumbs up emoji.

This commit is contained in:
Harshit Bansal
2017-09-26 20:54:28 +00:00
committed by Tim Abbott
parent 01b0a8156d
commit ef4337edcb
2 changed files with 9 additions and 1 deletions

View File

@@ -165,6 +165,11 @@ function stubbing(func_name_to_stub, test_function) {
set_global('emoji_picker', { set_global('emoji_picker', {
reactions_popped: return_false, reactions_popped: return_false,
}); });
set_global('emoji_codes', {
codepoint_to_name: {
'1f44d': 'thumbs_up',
},
});
set_global('hotspots', { set_global('hotspots', {
is_open: return_false, is_open: return_false,
}); });

View File

@@ -671,7 +671,10 @@ exports.process_hotkey = function (e, hotkey) {
reactions.open_reactions_popover(); reactions.open_reactions_popover();
return true; return true;
case 'thumbs_up_emoji': // '+': reacts with thumbs up emoji on selected message case 'thumbs_up_emoji': // '+': reacts with thumbs up emoji on selected message
reactions.toggle_emoji_reaction(msg.id, '+1'); // Use canonical name.
var thumbs_up_codepoint = '1f44d';
var canonical_name = emoji_codes.codepoint_to_name[thumbs_up_codepoint];
reactions.toggle_emoji_reaction(msg.id, canonical_name);
return true; return true;
case 'toggle_mute': case 'toggle_mute':
muting_ui.toggle_mute(msg); muting_ui.toggle_mute(msg);