mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
compose_state: Rename compost_state.recipient to be about PMs only.
The compose_state.recipient field was only actually the recipient for the message if it was a private_message_recipient (in the sense of other code); we store the stream in compose_state.stream instead. As a result, the name was quite confusing, resulting in the possibility of problematic correctness bugs where code assumes this field has a valid value for stream messages. Fix this by changing it to compose_state.private_message_recipient for clarity.
This commit is contained in:
@@ -27,7 +27,7 @@ exports.set_focused_recipient = function (msg_type) {
|
||||
} else {
|
||||
// Normalize the recipient list so it matches the one used when
|
||||
// adding the message (see message_store.add_message_metadata()).
|
||||
const reply_to = util.normalize_recipients(compose_state.recipient());
|
||||
const reply_to = util.normalize_recipients(compose_state.private_message_recipient());
|
||||
focused_recipient.reply_to = reply_to;
|
||||
focused_recipient.to_user_ids = people.reply_to_to_user_ids_string(reply_to);
|
||||
}
|
||||
@@ -73,7 +73,7 @@ function fade_messages() {
|
||||
|
||||
if (current_msg_list !== expected_msg_list ||
|
||||
!compose_state.composing() ||
|
||||
compose_state.recipient() !== expected_recipient) {
|
||||
compose_state.private_message_recipient() !== expected_recipient) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ function fade_messages() {
|
||||
}
|
||||
|
||||
floating_recipient_bar.update();
|
||||
}, 0, current_msg_list, compose_state.recipient());
|
||||
}, 0, current_msg_list, compose_state.private_message_recipient());
|
||||
}
|
||||
|
||||
exports.would_receive_message = function (email) {
|
||||
|
||||
Reference in New Issue
Block a user