Only request background color for stream messages.

subs.get_color is expecting a string, and so if you do this on
a PM, it breaks.

(imported from commit acf6d51b84d7bbbe643466f1f72f90a8f6cf16f6)
This commit is contained in:
Waseem Daher 2013-01-07 17:33:36 -05:00
parent b6e1024b69
commit 5501558fa7
1 changed files with 3 additions and 1 deletions

View File

@ -332,7 +332,9 @@ function add_to_table(messages, table_name, filter_function, where, allow_collap
message.stamp = ui.get_gravatar_stamp(); message.stamp = ui.get_gravatar_stamp();
} }
message.background_color = subs.get_color(message.display_recipient); if (message.is_stream) {
message.background_color = subs.get_color(message.display_recipient);
}
messages_to_render.push(message); messages_to_render.push(message);
prev = message; prev = message;