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,19 +365,20 @@ ...@@ -365,19 +365,20 @@
_converse.ChatRoom = _converse.ChatBox.extend({ _converse.ChatRoom = _converse.ChatBox.extend({
defaults: _.extend(_converse.ChatBox.prototype.defaults, { defaults: function () {
// For group chats, we distinguish between generally unread return _.extend(_converse.ChatBox.prototype.defaults, {
// messages and those ones that specifically mention the 'type': CHATROOMS_TYPE,
// user. // For group chats, we distinguish between generally unread
// // messages and those ones that specifically mention the
// To keep things simple, we reuse `num_unread` from // user.
// _converse.ChatBox to indicate unread messages which //
// mention the user and `num_unread_general` to indicate // To keep things simple, we reuse `num_unread` from
// generally unread messages (which *includes* mentions!). // _converse.ChatBox to indicate unread messages which
// FIXME: figure out why this breaks tests. // mention the user and `num_unread_general` to indicate
// 'type': CHATROOMS_TYPE, // generally unread messages (which *includes* mentions!).
'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