Commit bcc73fe7 authored by JC Brand's avatar JC Brand

converse-muc: `occupantAdded` promise has been removed

Also:

* converted two docstrings into JSDoc format
* Don't use `_.isNull`
parent 9c024757
......@@ -111,12 +111,10 @@ converse.plugins.add('converse-message-view', {
});
}
if (this.model.occupantAdded) {
this.model.occupantAdded.then(() => {
if (this.model.occupant) {
this.model.occupant.on('change:role', this.debouncedRender, this);
this.model.occupant.on('change:affiliation', this.debouncedRender, this);
this.debouncedRender();
});
}
this.model.on('change', this.onChanged, this);
......
......@@ -1010,20 +1010,26 @@ converse.plugins.add('converse-chatboxes', {
return this.trigger("show");
},
isHidden () {
/* Returns a boolean to indicate whether a newly received
* message will be visible to the user or not.
/**
* Indicates whether the chat is hidden and therefore
* whether a newly received message will be visible
* to the user or not.
* @returns {boolean}
*/
isHidden () {
return this.get('hidden') ||
this.get('minimized') ||
this.isScrolledUp() ||
_converse.windowState === 'hidden';
},
incrementUnreadMsgCounter (message) {
/* Given a newly received message, update the unread counter if
* necessary.
/**
* Given a newly received {@link _converse.Message} instance,
* update the unread counter if necessary.
* @private
* @param {_converse.Message} message
*/
incrementUnreadMsgCounter (message) {
if (!message || !message.get('message')) {
return;
}
......
......@@ -1602,7 +1602,7 @@ converse.plugins.add('converse-muc', {
* @param { XMLElement } stanza: The presence stanza received
*/
createInfoMessages (stanza) {
const is_self = !_.isNull(stanza.querySelector("status[code='110']"));
const is_self = stanza.querySelector("status[code='110']") !== null;
const x = sizzle(`x[xmlns="${Strophe.NS.MUC_USER}"]`, stanza).pop();
if (!x) {
return;
......
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