compose: Display error for non-admin trying to post to announce_only stream.

Partially fixes #4708.
Implements a first version (v1) for the feature. The next step would be
to allow admins to toggle `is_announcement_only` in the UI.
This commit is contained in:
Shubham Padia
2018-05-14 15:36:56 +05:30
committed by Tim Abbott
parent 9ad292cf2a
commit 10a65a62db
4 changed files with 53 additions and 0 deletions

View File

@@ -276,6 +276,14 @@ exports.get_invite_only = function (stream_name) {
return sub.invite_only;
};
exports.get_announcement_only = function (stream_name) {
var sub = exports.get_sub(stream_name);
if (sub === undefined) {
return false;
}
return sub.is_announcement_only;
};
var default_stream_ids = new Dict();
exports.set_realm_default_streams = function (realm_default_streams) {