Don't ignore groupchat messages that also contain a CSN
This commit is contained in:
parent
57709b2e78
commit
5e27579ebe
@ -116,6 +116,30 @@
|
|||||||
done();
|
done();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
it("can contain a chat state notification and will still be shown",
|
||||||
|
mock.initConverse(
|
||||||
|
['rosterGroupsFetched', 'chatBoxesFetched'], {},
|
||||||
|
async function (done, _converse) {
|
||||||
|
|
||||||
|
const muc_jid = 'lounge@montague.lit';
|
||||||
|
await test_utils.openAndEnterChatRoom(_converse, muc_jid, 'romeo');
|
||||||
|
const view = _converse.api.chatviews.get(muc_jid);
|
||||||
|
if (!view.el.querySelectorAll('.chat-area').length) { view.renderChatArea(); }
|
||||||
|
const message = 'romeo: Your attention is required';
|
||||||
|
const nick = mock.chatroom_names[0],
|
||||||
|
msg = $msg({
|
||||||
|
from: 'lounge@montague.lit/'+nick,
|
||||||
|
id: u.getUniqueId(),
|
||||||
|
to: 'romeo@montague.lit',
|
||||||
|
type: 'groupchat'
|
||||||
|
}).c('body').t(message)
|
||||||
|
.c('active', {'xmlns': "http://jabber.org/protocol/chatstates"})
|
||||||
|
.tree();
|
||||||
|
await view.model.queueMessage(msg);
|
||||||
|
await new Promise(resolve => view.once('messageInserted', resolve));
|
||||||
|
expect(view.el.querySelector('.chat-msg')).not.toBe(null);
|
||||||
|
done();
|
||||||
|
}));
|
||||||
|
|
||||||
it("is specially marked when you are mentioned in it",
|
it("is specially marked when you are mentioned in it",
|
||||||
mock.initConverse(
|
mock.initConverse(
|
||||||
|
@ -1950,7 +1950,8 @@ converse.plugins.add('converse-muc', {
|
|||||||
|
|
||||||
if (attrs['chat_state']) {
|
if (attrs['chat_state']) {
|
||||||
this.updateCSN(attrs);
|
this.updateCSN(attrs);
|
||||||
} else if (u.shouldCreateGroupchatMessage(attrs)) {
|
}
|
||||||
|
if (u.shouldCreateGroupchatMessage(attrs)) {
|
||||||
const msg = this.handleCorrection(attrs) || await this.createMessage(attrs);
|
const msg = this.handleCorrection(attrs) || await this.createMessage(attrs);
|
||||||
this.incrementUnreadMsgCounter(msg);
|
this.incrementUnreadMsgCounter(msg);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user