Add a MessageList method to update message recipients.

(imported from commit 3c24f045aa5726fcab8b9acd91105044e7783b63)
This commit is contained in:
Jessica McKellar 2013-08-22 13:57:48 -04:00
parent 8f3c5dc924
commit 081ae7771a
1 changed files with 12 additions and 0 deletions

View File

@ -334,6 +334,18 @@ MessageList.prototype = {
get_row: function (id) {
return this.view.get_row(id);
},
change_display_recipient: function MessageList_change_display_recipient(old_recipient,
new_recipient) {
// This method only works for streams.
_.each(this._items, function (item) {
if (item.display_recipient === old_recipient) {
item.display_recipient = new_recipient;
item.stream = new_recipient;
}
});
this.view.rerender_the_whole_thing();
}
};