createOutboundGroupSession method

Future<OutboundGroupSession> createOutboundGroupSession(
  1. String roomId
)

Creates an outbound group session for a given room id

Implementation

Future<OutboundGroupSession> createOutboundGroupSession(String roomId) async {
  final sess = _pendingNewOutboundGroupSessions[roomId];
  if (sess != null) {
    return sess;
  }
  final newSess = _pendingNewOutboundGroupSessions[roomId] =
      _createOutboundGroupSession(roomId);

  try {
    await newSess;
  } finally {
    _pendingNewOutboundGroupSessions
        .removeWhere((_, value) => value == newSess);
  }

  return newSess;
}