select_message_by_id: Fix return value when already selected

(imported from commit c86509f6cf040d6acb771764d7fe2b40afa72fe3)
This commit is contained in:
Keegan McAllister 2012-10-23 19:34:54 -04:00
parent 20ae526963
commit 718018bbf6

View File

@ -195,7 +195,8 @@ function respond_to_message(reply_type) {
function select_message_by_id(message_id, opts) {
opts = $.extend({}, {then_scroll: false, update_server: true}, opts);
if (message_id === selected_message_id && ! opts.then_scroll) {
return;
// We are already successful without doing anything!
return true;
}
return select_message(rows.get(message_id), opts);
}