mirror of https://github.com/zulip/zulip.git
user_topics: Rename set_muted_topics to set_user_topics.
We should now rename set_muted_topics to set_user_topics as with the new user_topic event, there will be various types of user-topic configurations to handle other than just muting topics.
This commit is contained in:
parent
03d9418010
commit
0d9b1547ce
|
@ -44,7 +44,7 @@ stream_data.add_sub(social);
|
||||||
|
|
||||||
function test(label, f) {
|
function test(label, f) {
|
||||||
run_test(label, ({override}) => {
|
run_test(label, ({override}) => {
|
||||||
user_topics.set_muted_topics([]);
|
user_topics.set_user_topics([]);
|
||||||
muted_users.set_muted_users([]);
|
muted_users.set_muted_users([]);
|
||||||
f({override});
|
f({override});
|
||||||
});
|
});
|
||||||
|
@ -189,7 +189,7 @@ test("unknown streams", () => {
|
||||||
test("set_user_topics", () => {
|
test("set_user_topics", () => {
|
||||||
blueslip.expect("warn", "Unknown stream ID in set_user_topic: 999");
|
blueslip.expect("warn", "Unknown stream ID in set_user_topic: 999");
|
||||||
|
|
||||||
user_topics.set_muted_topics([]);
|
user_topics.set_user_topics([]);
|
||||||
assert.ok(!user_topics.is_topic_muted(social.stream_id, "breakfast"));
|
assert.ok(!user_topics.is_topic_muted(social.stream_id, "breakfast"));
|
||||||
assert.ok(!user_topics.is_topic_muted(design.stream_id, "typography"));
|
assert.ok(!user_topics.is_topic_muted(design.stream_id, "typography"));
|
||||||
|
|
||||||
|
@ -243,9 +243,9 @@ test("set_user_topics", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("case_insensitivity", () => {
|
test("case_insensitivity", () => {
|
||||||
user_topics.set_muted_topics([]);
|
user_topics.set_user_topics([]);
|
||||||
assert.ok(!user_topics.is_topic_muted(social.stream_id, "breakfast"));
|
assert.ok(!user_topics.is_topic_muted(social.stream_id, "breakfast"));
|
||||||
user_topics.set_muted_topics([
|
user_topics.set_user_topics([
|
||||||
{
|
{
|
||||||
stream_id: social.stream_id,
|
stream_id: social.stream_id,
|
||||||
topic_name: "breakfast",
|
topic_name: "breakfast",
|
||||||
|
|
|
@ -23,7 +23,7 @@ const params = {
|
||||||
function test(label, f) {
|
function test(label, f) {
|
||||||
run_test(label, ({override}) => {
|
run_test(label, ({override}) => {
|
||||||
pmc.clear_for_testing();
|
pmc.clear_for_testing();
|
||||||
user_topics.set_muted_topics([]);
|
user_topics.set_user_topics([]);
|
||||||
muted_users.set_muted_users([]);
|
muted_users.set_muted_users([]);
|
||||||
people.initialize_current_user(15);
|
people.initialize_current_user(15);
|
||||||
f({override});
|
f({override});
|
||||||
|
|
|
@ -57,7 +57,7 @@ function test_notifiable_count(home_unread_messages, expected_notifiable_count)
|
||||||
function test(label, f) {
|
function test(label, f) {
|
||||||
run_test(label, (helpers) => {
|
run_test(label, (helpers) => {
|
||||||
unread.declare_bankruptcy();
|
unread.declare_bankruptcy();
|
||||||
user_topics.set_muted_topics([]);
|
user_topics.set_user_topics([]);
|
||||||
f(helpers);
|
f(helpers);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ export function set_user_topic(user_topic) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function set_muted_topics(user_topics) {
|
export function set_user_topics(user_topics) {
|
||||||
muted_topics.clear();
|
muted_topics.clear();
|
||||||
|
|
||||||
for (const user_topic of user_topics) {
|
for (const user_topic of user_topics) {
|
||||||
|
@ -89,5 +89,5 @@ export function set_muted_topics(user_topics) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function initialize() {
|
export function initialize() {
|
||||||
set_muted_topics(page_params.user_topics);
|
set_user_topics(page_params.user_topics);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue