|
@@ -17,6 +17,7 @@ export default function ModelWithContact(BaseModel) {
|
|
|
initialize() {
|
|
|
super.initialize();
|
|
|
this.rosterContactAdded = getOpenPromise();
|
|
|
+ this.onClosedChanged = () => this.setModelContact(this.get('jid'));
|
|
|
/**
|
|
|
* @public
|
|
|
* @type {RosterContact|Profile}
|
|
@@ -24,12 +25,19 @@ export default function ModelWithContact(BaseModel) {
|
|
|
this.contact = null;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* @param {string} jid
|
|
|
*/
|
|
|
async setModelContact(jid) {
|
|
|
if (this.contact?.get('jid') === jid) return;
|
|
|
|
|
|
+ if (this.get('closed')) {
|
|
|
+ this.off('change:closed', this.onClosedChanged);
|
|
|
+ this.on('change:closed', this.onClosedChanged);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
const { session, state } = _converse;
|
|
|
|
|
|
let contact;
|