mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
refactor: Avoid positional params for MessageList.
We used to have positional parameters for table_name
and filter, but we don't use them for message_list.all
and we're about to replace filter in some cases.
Passing everything in on opts is more consistent and
self-documenting in the calling code, plus lots of
unit tests can get away with passing in `{}` now
for situations where table_name does not matter.
All of our callers pass in muting_enabled, so we
remove the default value for it. And then the
collapse_messages variable doesn't have to live on
`this` as it's only being passed through down to the
view.
This commit is contained in:
@@ -2,12 +2,11 @@
|
||||
// global variables from Zulip (everything is being moved into
|
||||
// modules). Please don't add things here.
|
||||
|
||||
var home_msg_list = new message_list.MessageList(
|
||||
'zhome',
|
||||
new Filter([{operator: "in",
|
||||
operand: "home"}]),
|
||||
{muting_enabled: true}
|
||||
);
|
||||
var home_msg_list = new message_list.MessageList({
|
||||
table_name: 'zhome',
|
||||
filter: new Filter([{operator: "in", operand: "home"}]),
|
||||
muting_enabled: true,
|
||||
});
|
||||
var current_msg_list = home_msg_list;
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
|
||||
Reference in New Issue
Block a user