muting: Replace muted_topics Dict with IntDict.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2020-01-31 19:10:14 -08:00
committed by Tim Abbott
parent e10da9c85f
commit 052497de1c
2 changed files with 3 additions and 6 deletions

View File

@@ -6,9 +6,6 @@ set_global('page_params', {});
run_test('edge_cases', () => {
// private messages
assert(!muting.is_topic_muted(undefined, undefined));
// defensive
assert(!muting.is_topic_muted('nonexistent', undefined));
});
const design = {

View File

@@ -1,7 +1,7 @@
const Dict = require('./dict').Dict;
const FoldDict = require('./fold_dict').FoldDict;
const IntDict = require('./int_dict').IntDict;
let muted_topics = new Dict();
const muted_topics = new IntDict();
exports.add_muted_topic = function (stream_id, topic) {
let sub_dict = muted_topics.get(stream_id);
@@ -38,7 +38,7 @@ exports.get_muted_topics = function () {
};
exports.set_muted_topics = function (tuples) {
muted_topics = new Dict();
muted_topics.clear();
_.each(tuples, function (tuple) {
const stream_name = tuple[0];