Fade around new recipient when restoring a draft.

(imported from commit 7888ae124bfba150b354ba27cb12c99364b43263)
This commit is contained in:
Tim Abbott 2013-04-18 15:36:55 -04:00
parent f407d6b935
commit 26b0eb341e
1 changed files with 9 additions and 0 deletions

View File

@ -243,6 +243,7 @@ function create_message_object() {
if (message.type === "private") {
// TODO: this should be collapsed with the code in composebox_typeahead.js
message.to = compose.recipient().split(/\s*[,;]\s*/);
message.reply_to = compose.recipient();
} else {
message.to = compose.stream_name();
}
@ -274,6 +275,14 @@ exports.restore_message = function() {
return;
}
var snapshot_copy = $.extend({}, message_snapshot);
if ((snapshot_copy.type === "stream" &&
snapshot_copy.stream.length > 0 &&
snapshot_copy.subject.length > 0) ||
(snapshot_copy.type === "private" &&
snapshot_copy.reply_to.length > 0)) {
snapshot_copy = $.extend({replying_to_message: snapshot_copy},
snapshot_copy);
}
clear_message_snapshot();
exports.unfade_messages(true);
compose.start(snapshot_copy.type, snapshot_copy);