Commit f9fb13a7 authored by JC Brand's avatar JC Brand

muc: Make `defaults` a function

otherwise also the prototype's defaults gets overwritten.
parent b5ecc1fc
...@@ -365,7 +365,9 @@ ...@@ -365,7 +365,9 @@
_converse.ChatRoom = _converse.ChatBox.extend({ _converse.ChatRoom = _converse.ChatBox.extend({
defaults: _.extend(_converse.ChatBox.prototype.defaults, { defaults: function () {
return _.extend(_converse.ChatBox.prototype.defaults, {
'type': CHATROOMS_TYPE,
// For group chats, we distinguish between generally unread // For group chats, we distinguish between generally unread
// messages and those ones that specifically mention the // messages and those ones that specifically mention the
// user. // user.
...@@ -374,10 +376,9 @@ ...@@ -374,10 +376,9 @@
// _converse.ChatBox to indicate unread messages which // _converse.ChatBox to indicate unread messages which
// mention the user and `num_unread_general` to indicate // mention the user and `num_unread_general` to indicate
// generally unread messages (which *includes* mentions!). // generally unread messages (which *includes* mentions!).
// FIXME: figure out why this breaks tests.
// 'type': CHATROOMS_TYPE,
'num_unread_general': 0 'num_unread_general': 0
}), });
},
isUserMentioned: function (message) { isUserMentioned: function (message) {
/* Returns a boolean to indicate whether the current user /* Returns a boolean to indicate whether the current user
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment