minor: Alphabetize cases for event dispatching.

This commit is contained in:
Steve Howell
2018-08-25 11:08:24 +00:00
committed by Tim Abbott
parent d96d6a96f7
commit ffb6f5099c

View File

@@ -14,11 +14,33 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
attachments_ui.update_attachments(event);
break;
case 'custom_profile_fields':
page_params.custom_profile_fields = event.fields;
settings_profile_fields.populate_profile_fields(page_params.custom_profile_fields);
settings_account.add_custom_profile_fields_to_settings();
break;
case 'default_streams':
stream_data.set_realm_default_streams(event.default_streams);
settings_streams.update_default_streams_table();
break;
case 'delete_message':
var msg_id = event.message_id;
// message is passed to unread.get_unread_messages,
// which returns all the unread messages out of a given list.
// So double marking something as read would not occur
unread_ops.process_read_messages_event([msg_id]);
if (event.message_type === 'stream') {
topic_data.remove_message({
stream_id: event.stream_id,
topic_name: event.topic,
});
stream_list.update_streams_sidebar();
}
ui.remove_message(msg_id);
break;
case 'hotspots':
hotspots.load_new(event.hotspots);
page_params.hotspots = page_params.hotspots ?
@@ -178,12 +200,6 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
settings_filters.populate_filters(page_params.realm_filters);
break;
case 'custom_profile_fields':
page_params.custom_profile_fields = event.fields;
settings_profile_fields.populate_profile_fields(page_params.custom_profile_fields);
settings_account.add_custom_profile_fields_to_settings();
break;
case 'realm_domains':
var i;
if (event.op === 'add') {
@@ -422,22 +438,6 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
}
break;
case 'delete_message':
var msg_id = event.message_id;
// message is passed to unread.get_unread_messages,
// which returns all the unread messages out of a given list.
// So double marking something as read would not occur
unread_ops.process_read_messages_event([msg_id]);
if (event.message_type === 'stream') {
topic_data.remove_message({
stream_id: event.stream_id,
topic_name: event.topic,
});
stream_list.update_streams_sidebar();
}
ui.remove_message(msg_id);
break;
case 'user_group':
if (event.op === 'add') {
user_groups.add(event.group);