fix(xep): Somehow fix reconnection issues
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
PapaTutuWawa 2023-09-23 22:19:06 +02:00
parent c504afc944
commit 4a681b9483

View File

@ -65,6 +65,7 @@ class MUCManager extends XmppManagerBase {
return; return;
} }
final mucJoins = List<MUCRoomJoin>.empty(growable: true);
await _cacheLock.synchronized(() async { await _cacheLock.synchronized(() async {
// Mark all groupchats as not joined. // Mark all groupchats as not joined.
for (final jid in _mucRoomCache.keys) { for (final jid in _mucRoomCache.keys) {
@ -72,14 +73,19 @@ class MUCManager extends XmppManagerBase {
// Re-join all MUCs. // Re-join all MUCs.
final state = _mucRoomCache[jid]!; final state = _mucRoomCache[jid]!;
mucJoins.add((jid, state.nick!));
}
});
for (final join in mucJoins) {
final (jid, nick) = join;
await _sendMucJoin( await _sendMucJoin(
jid, jid,
state.nick!, nick,
0, 0,
); );
} }
_joinedPreparedRooms = true; _joinedPreparedRooms = true;
});
} }
/// Prepares the internal room list to ensure that the rooms /// Prepares the internal room list to ensure that the rooms