mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
subscribers: Extract subscriber_api.
This simplifies some of our dependencies.
As an example, we really don't want compose.js
to depend on stream_subscribers_ui.js, since
the former doesn't use any actual UI code from
the latter.
We also rename the two functions here:
invite_user_to_stream -> add_user_ids_to_stream
remove_user_from_stream -> remove_user_id_from_stream
(The notion of "inviting" somebody to a stream is
somewhat misleading, since there is really no invitation
mechanism; you just add them.)
Apart from naming changes this is a verbatim code move.
Finally, we eliminate a little bit of test cruft--the
`override` helper already ensures that a function gets
called at least once during a test.
This commit is contained in:
@@ -27,8 +27,8 @@ import * as sent_messages from "./sent_messages";
|
||||
import * as server_events from "./server_events";
|
||||
import * as stream_data from "./stream_data";
|
||||
import * as stream_settings_ui from "./stream_settings_ui";
|
||||
import * as stream_subscribers_ui from "./stream_subscribers_ui";
|
||||
import * as sub_store from "./sub_store";
|
||||
import * as subscriber_api from "./subscriber_api";
|
||||
import * as transmit from "./transmit";
|
||||
import * as ui_report from "./ui_report";
|
||||
import * as upload from "./upload";
|
||||
@@ -507,7 +507,7 @@ export function initialize() {
|
||||
|
||||
const sub = sub_store.get(stream_id);
|
||||
|
||||
stream_subscribers_ui.invite_user_to_stream([user_id], sub, success, xhr_failure);
|
||||
subscriber_api.add_user_ids_to_stream([user_id], sub, success, xhr_failure);
|
||||
});
|
||||
|
||||
$("#compose_invite_users").on("click", ".compose_invite_close", (event) => {
|
||||
|
||||
Reference in New Issue
Block a user