server events: Add realm-time-sync event to update stream privacy.

Add event to update stream settings whenever stream privacy is changed
accordingly.

Fixes #9470
This commit is contained in:
Yashashvi Dave
2019-05-02 23:13:27 +05:30
committed by Tim Abbott
parent a68a06d94f
commit 02a1b2e26b
7 changed files with 104 additions and 5 deletions

View File

@@ -74,6 +74,15 @@ exports.update_property = function (stream_id, property, value, other_values) {
update_stream_pin(sub, value);
stream_list.refresh_pinned_or_unpinned_stream(sub);
break;
case 'invite_only':
subs.update_stream_privacy(sub, {
invite_only: value,
history_public_to_subscribers: other_values.history_public_to_subscribers,
});
break;
case 'is_announcement_only':
subs.update_stream_announcement_only(sub, value);
break;
default:
blueslip.warn("Unexpected subscription property type", {property: property,
value: value});