mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
reminders: Make reminders setup work only for Streams.
We make this change because setting up reminders in PM's didn't play really well with our current infrastructure. Basically the reminder messages from the bot can't appear in the same narrow as that of a PM between two people and therefore we disable it. Though we make an exception here where a person wants to set up reminder for himself.
This commit is contained in:
committed by
Tim Abbott
parent
bb7c9a544b
commit
4e4c33fee2
@@ -1990,6 +1990,12 @@ def check_schedule_message(sender: UserProfile, client: Client,
|
||||
forwarder_user_profile=forwarder_user_profile)
|
||||
message['deliver_at'] = deliver_at
|
||||
message['delivery_type'] = delivery_type
|
||||
|
||||
recipient = message['message'].recipient
|
||||
if (delivery_type == 'remind' and (recipient.type != Recipient.STREAM and
|
||||
recipient.type_id != sender.id)):
|
||||
raise JsonableError(_("Reminders can only be set for streams."))
|
||||
|
||||
return do_schedule_messages([message])[0]
|
||||
|
||||
def check_stream_name(stream_name: str) -> None:
|
||||
|
||||
Reference in New Issue
Block a user