compose: Don't clear the compose box when recipient didn't change.

(imported from commit 5188a0f510e499c80d4c188a1ce59af4f2fe3262)
This commit is contained in:
Tim Abbott
2013-03-12 15:27:38 -04:00
parent 10be8d2a12
commit ee8d646d74

View File

@@ -126,8 +126,6 @@ exports.start = function (msg_type, opts) {
return;
}
compose.clear();
var default_opts = {
message_type: msg_type,
stream: '',
@@ -140,6 +138,16 @@ exports.start = function (msg_type, opts) {
opts = $.extend(default_opts, opts);
if (!(compose.composing() === msg_type &&
((msg_type === "stream" &&
opts.stream === compose.stream() &&
opts.subject === compose.subject()) ||
(msg_type === "private" &&
opts.private_message_recipient === compose.recipient())))) {
// Clear the compose box if the existing message is to a different recipient
compose.clear();
}
compose.stream_name(opts.stream);
compose.subject(opts.subject);
compose.recipient(opts.private_message_recipient);