Skip to content

Commit

Permalink
Add M hotkey to toggle mute/unmute topics.
Browse files Browse the repository at this point in the history
Get rid of current_msg_list.selected_message() redundancy.
  • Loading branch information
lonerz authored and showell committed Mar 25, 2017
1 parent dc9f830 commit 76e8428
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions static/js/hotkey.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ var keypress_mappings = {
71: {name: 'G_end', message_view_only: true}, // 'G'
74: {name: 'vim_page_down', message_view_only: true}, // 'J'
75: {name: 'vim_page_up', message_view_only: true}, // 'K'
77: {name: 'toggle_mute', message_view_only: true}, // 'M'
80: {name: 'narrow_private', message_view_only: true}, // 'P'
82: {name: 'respond_to_author', message_view_only: true}, // 'R'
83: {name: 'narrow_by_subject', message_view_only: true}, //'S'
Expand Down Expand Up @@ -610,12 +611,13 @@ exports.process_hotkey = function (e, hotkey) {
return true;
}

var msg = current_msg_list.selected_message();
// Shortcuts that operate on a message
switch (event_name) {
case 'message_actions':
return popovers.open_message_menu();
case 'star_message':
return message_flags.toggle_starred(current_msg_list.selected_message());
return message_flags.toggle_starred(msg);
case 'narrow_by_recipient':
return do_narrow_action(narrow.by_recipient);
case 'narrow_by_subject':
Expand All @@ -638,7 +640,10 @@ exports.process_hotkey = function (e, hotkey) {
open_reactions();
return true;
case 'thumbs_up_emoji': // '+': reacts with thumbs up emoji on selected message
reactions.toggle_reaction(current_msg_list.selected_id(), '+1');
reactions.toggle_reaction(msg.id, '+1');
return true;
case 'toggle_mute':
muting_ui.toggle_mute(msg);
return true;
}

Expand Down

0 comments on commit 76e8428

Please sign in to comment.