mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 19:31:58 +00:00
Remove notify_for_streams_by_default.
(imported from commit 9963c97ffec82fe7cf2921bd51422545c29a8915)
This commit is contained in:
@@ -1032,20 +1032,6 @@ def notify_subscriptions_added(user_profile, sub_pairs, stream_emails, no_log=Fa
|
|||||||
subscriptions=payload)
|
subscriptions=payload)
|
||||||
send_event(event, [user_profile.id])
|
send_event(event, [user_profile.id])
|
||||||
|
|
||||||
def notify_for_streams_by_default(user_profile):
|
|
||||||
# For users in older realms and CUSTOMER19, do not generate notifications
|
|
||||||
# for stream messages by default. Everyone else uses the setting on the
|
|
||||||
# user_profile.
|
|
||||||
|
|
||||||
if (user_profile.realm.domain in ["customer19.invalid", "customer25.invalid"] or
|
|
||||||
user_profile.realm.date_created <= datetime.datetime(2013, 9, 24,
|
|
||||||
tzinfo=timezone.utc)):
|
|
||||||
return False
|
|
||||||
|
|
||||||
return user_profile.default_desktop_notifications
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def bulk_add_subscriptions(streams, users):
|
def bulk_add_subscriptions(streams, users):
|
||||||
recipients_map = bulk_get_recipients(Recipient.STREAM, [stream.id for stream in streams])
|
recipients_map = bulk_get_recipients(Recipient.STREAM, [stream.id for stream in streams])
|
||||||
recipients = [recipient.id for recipient in recipients_map.values()]
|
recipients = [recipient.id for recipient in recipients_map.values()]
|
||||||
@@ -1169,7 +1155,7 @@ def do_add_subscription(user_profile, stream, no_log=False):
|
|||||||
(subscription, created) = Subscription.objects.get_or_create(
|
(subscription, created) = Subscription.objects.get_or_create(
|
||||||
user_profile=user_profile, recipient=recipient,
|
user_profile=user_profile, recipient=recipient,
|
||||||
defaults={'active': True, 'color': color,
|
defaults={'active': True, 'color': color,
|
||||||
'notifications': notify_for_streams_by_default(user_profile)})
|
'notifications': user_profile.default_desktop_notifications})
|
||||||
did_subscribe = created
|
did_subscribe = created
|
||||||
if not subscription.active:
|
if not subscription.active:
|
||||||
did_subscribe = True
|
did_subscribe = True
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ from zerver.lib.actions import bulk_remove_subscriptions, do_change_password, \
|
|||||||
user_email_is_unique, do_invite_users, do_refer_friend, compute_mit_user_fullname, \
|
user_email_is_unique, do_invite_users, do_refer_friend, compute_mit_user_fullname, \
|
||||||
do_add_alert_words, do_remove_alert_words, do_set_alert_words, get_subscriber_emails, \
|
do_add_alert_words, do_remove_alert_words, do_set_alert_words, get_subscriber_emails, \
|
||||||
do_set_muted_topics, do_rename_stream, clear_followup_emails_queue, \
|
do_set_muted_topics, do_rename_stream, clear_followup_emails_queue, \
|
||||||
notify_for_streams_by_default, do_change_enable_offline_push_notifications, \
|
do_change_enable_offline_push_notifications, \
|
||||||
do_deactivate_stream, do_change_autoscroll_forever, do_make_stream_public, \
|
do_deactivate_stream, do_change_autoscroll_forever, do_make_stream_public, \
|
||||||
do_add_default_stream, do_change_default_all_public_streams, \
|
do_add_default_stream, do_change_default_all_public_streams, \
|
||||||
do_change_default_desktop_notifications, \
|
do_change_default_desktop_notifications, \
|
||||||
@@ -1084,7 +1084,6 @@ def home(request):
|
|||||||
realm_filters = register_ret['realm_filters'],
|
realm_filters = register_ret['realm_filters'],
|
||||||
is_admin = user_profile.is_admin(),
|
is_admin = user_profile.is_admin(),
|
||||||
can_create_streams = user_profile.can_create_streams(),
|
can_create_streams = user_profile.can_create_streams(),
|
||||||
notify_for_streams_by_default = notify_for_streams_by_default(user_profile),
|
|
||||||
name_changes_disabled = name_changes_disabled(user_profile.realm),
|
name_changes_disabled = name_changes_disabled(user_profile.realm),
|
||||||
has_mobile_devices = num_push_devices_for_user(user_profile) > 0,
|
has_mobile_devices = num_push_devices_for_user(user_profile) > 0,
|
||||||
autoscroll_forever = user_profile.autoscroll_forever,
|
autoscroll_forever = user_profile.autoscroll_forever,
|
||||||
|
|||||||
Reference in New Issue
Block a user