MUC: When closing, only send read marker if we were entered

When using RAI, it's possible to close a MUC without it being entered.
This commit is contained in:
JC Brand 2022-08-17 12:16:03 +02:00
parent 97be0bd8ac
commit 0d9561e666

View File

@ -886,8 +886,11 @@ const ChatRoomMixin = {
},
async close (ev) {
safeSave(this.session, { 'connection_status': converse.ROOMSTATUS.CLOSING });
this.sendMarkerForLastMessage('received', true);
const { ENTERED, CLOSING } = converse.ROOMSTATUS;
const was_entered = this.session.get('connection_status') === ENTERED;
safeSave(this.session, { 'connection_status': CLOSING });
was_entered && this.sendMarkerForLastMessage('received', true);
await this.unregisterNickname();
await this.leave();