forgetRoom method

  1. @override
Future<void> forgetRoom(
  1. String roomId
)
override

Implementation

@override
Future<void> forgetRoom(String roomId) async {
  await _timelineFragmentsBox.delete(MultiKey(roomId, '').toString());
  for (final key in _eventsBox.keys) {
    final multiKey = MultiKey.fromString(key);
    if (multiKey.parts.first != roomId) continue;
    await _eventsBox.delete(key);
  }
  for (final key in _roomStateBox.keys) {
    final multiKey = MultiKey.fromString(key);
    if (multiKey.parts.first != roomId) continue;
    await _roomStateBox.delete(key);
  }
  for (final key in _roomMembersBox.keys) {
    final multiKey = MultiKey.fromString(key);
    if (multiKey.parts.first != roomId) continue;
    await _roomMembersBox.delete(key);
  }
  for (final key in _roomAccountDataBox.keys) {
    final multiKey = MultiKey.fromString(key);
    if (multiKey.parts.first != roomId) continue;
    await _roomAccountDataBox.delete(key);
  }
  await _roomsBox.delete(roomId.toHiveKey);
}