mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
Use switch/case in add_zephyr_metadata
(imported from commit f5a2357a4359d3e16d22a0c561561c5f54b16538)
This commit is contained in:
parent
6c57d071cc
commit
d8714ae3ff
@ -685,7 +685,8 @@ function add_to_table(zephyrs, table_name, filter_function) {
|
||||
function add_zephyr_metadata(dummy, zephyr) {
|
||||
last_received = Math.max(last_received, zephyr.id);
|
||||
|
||||
if (zephyr.type === 'class') {
|
||||
switch (zephyr.type) {
|
||||
case 'class':
|
||||
zephyr.is_class = true;
|
||||
if ($.inArray(zephyr.display_recipient, class_list) === -1) {
|
||||
class_list.push(zephyr.display_recipient);
|
||||
@ -695,10 +696,14 @@ function add_zephyr_metadata(dummy, zephyr) {
|
||||
instance_list.push(zephyr.instance);
|
||||
update_autocomplete();
|
||||
}
|
||||
} else if (zephyr.type === "huddle") {
|
||||
break;
|
||||
|
||||
case 'huddle':
|
||||
zephyr.is_huddle = true;
|
||||
zephyr.reply_to = get_huddle_recipient(zephyr);
|
||||
} else {
|
||||
break;
|
||||
|
||||
case 'personal':
|
||||
zephyr.is_personal = true;
|
||||
|
||||
if (zephyr.display_recipient === email) { // that is, we sent the original message
|
||||
@ -712,6 +717,7 @@ function add_zephyr_metadata(dummy, zephyr) {
|
||||
people_list.push(zephyr.reply_to);
|
||||
update_autocomplete();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
var time = new Date(zephyr.timestamp * 1000);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user