streams: Refactor multi-option helpers into separate functions.

For internal stream messages, most of the time, we have access to
a Stream object. For the few corner cases where we don't, it is a
much cleaner approach to have a separate function that accepts a
stream name than having one multi-option helper that accepts both
names and objects.
This commit is contained in:
Eeshan Garg
2019-02-08 22:31:35 -03:30
committed by Tim Abbott
parent c7a9faa803
commit 179b747769
7 changed files with 63 additions and 34 deletions

View File

@@ -78,9 +78,8 @@ From image editing program:
] # type: List[Dict[str, Any]]
messages = [internal_prep_stream_message(
realm, message['sender'],
'message formatting', message['content'],
stream=stream
realm, message['sender'], stream,
'message formatting', message['content']
) for message in staged_messages]
message_ids = do_send_messages(messages)