createGroupCallForRoom method

Future<void> createGroupCallForRoom(
  1. Room room
)

Create a new group call in an existing room.

Implementation

Future<void> createGroupCallForRoom(Room room) async {
  final events = await client.getRoomState(room.id);
  events.sort((a, b) => a.originServerTs.compareTo(b.originServerTs));

  for (final event in events) {
    if (event.type == EventTypes.GroupCallPrefix) {
      if (event.content['m.terminated'] != null) {
        return;
      }
      await createGroupCallFromRoomStateEvent(event);
    }
  }

  return;
}