# onXmppEvent method

1. @override

Future <void> onXmppEvent(

1. XmppEvent event

)
override

Called when XmppConnection triggers an event

## Implementation

    @override
    Future<void> onXmppEvent(XmppEvent event) async {
      if (event is! StreamNegotiationsDoneEvent) {
        return;
      }

      // Only attempt rejoining if we did not resume the stream and all
      // prepared rooms are already joined.
      if (event.resumed && _joinedPreparedRooms) {
        return;
      }

      final mucJoins = List<MUCRoomJoin>.empty(growable: true);
      await _cacheLock.synchronized(() async {
        // Mark all groupchats as not joined.
        for (final jid in _mucRoomCache.keys) {
          _mucRoomCache[jid]!.joined = false;
          _mucRoomJoinCompleter[jid] = Completer();

          // Re-join all MUCs.
          final state = _mucRoomCache[jid]!;
          mucJoins.add((jid, state.nick!));
        }
      });

      for (final join in mucJoins) {
        final (jid, nick) = join;
        await _sendMucJoin(
          jid,
          nick,
          0,
        );
      }
      _joinedPreparedRooms = true;
    }