notification bot: Modify initial stream creation message.

Discussion at
https://chat.zulip.org/#narrow/stream/137-feedback/topic/hello.20topic

The "by @**X**" part in the message content is in a later commit.
This commit is contained in:
Rishi Gupta
2019-07-11 09:32:38 -07:00
committed by Tim Abbott
parent 1d3312eede
commit 7de7b6872b
3 changed files with 7 additions and 43 deletions

View File

@@ -1709,20 +1709,11 @@ def check_typing_notification(sender: UserProfile,
assert recipient.type != Recipient.STREAM
return {'sender': sender, 'recipient': recipient, 'op': operator}
def stream_welcome_message(stream: Stream) -> str:
content = _('Welcome to #**%s**.') % (stream.name,)
if stream.description:
content += '\n\n**' + _('Description') + '**: '
content += stream.description
return content
def prep_stream_welcome_message(stream: Stream) -> Optional[Dict[str, Any]]:
realm = stream.realm
sender = get_system_bot(settings.WELCOME_BOT)
topic = _('hello')
content = stream_welcome_message(stream)
sender = get_system_bot(settings.NOTIFICATION_BOT)
topic = _('stream events')
content = _('Stream created. Welcome!')
message = internal_prep_stream_message(
realm=realm,