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:
Tim Abbott
2019-12-02 08:53:55 -08:00
parent 65270419b9
commit ea7c6d395f
13 changed files with 34 additions and 33 deletions

View File

@@ -163,7 +163,7 @@ run_test('snapshot_message', () => {
global.compose_state.message_content = function () {
return draft.content;
};
global.compose_state.recipient = function () {
global.compose_state.private_message_recipient = function () {
return draft.private_message_recipient;
};
global.compose_state.stream_name = function () {