|
@@ -1853,11 +1853,19 @@ export default class ChatRoom extends Listenable {
|
1853
|
1853
|
}
|
1854
|
1854
|
};
|
1855
|
1855
|
|
1856
|
|
- timeout = setTimeout(() => onMucLeft(true), 5000);
|
|
1856
|
+ if (this.joined) {
|
|
1857
|
+ timeout = setTimeout(() => onMucLeft(true), 5000);
|
1857
|
1858
|
|
1858
|
|
- this.clean();
|
1859
|
|
- this.eventEmitter.on(XMPPEvents.MUC_LEFT, onMucLeft);
|
1860
|
|
- this.doLeave(reason);
|
|
1859
|
+ this.clean();
|
|
1860
|
+ this.eventEmitter.on(XMPPEvents.MUC_LEFT, onMucLeft);
|
|
1861
|
+ this.doLeave(reason);
|
|
1862
|
+ } else {
|
|
1863
|
+ // we are clearing up, and we haven't joined the room
|
|
1864
|
+ // there is no point of sending presence unavailable and check for timeout
|
|
1865
|
+ // let's just clean
|
|
1866
|
+ this.connection.emuc.doLeave(this.roomjid);
|
|
1867
|
+ this.clean();
|
|
1868
|
+ }
|
1861
|
1869
|
}));
|
1862
|
1870
|
|
1863
|
1871
|
return Promise.allSettled(promises);
|