fix: salas removidas de vez, paginação no mural, mídia em largura total e teclado nos comentários
This commit is contained in:
@@ -413,8 +413,9 @@ class ChatListController extends State<ChatList>
|
||||
|
||||
scrollController.addListener(_onScroll);
|
||||
_waitForFirstSync();
|
||||
_backfillSubscription =
|
||||
_clientStream.stream.listen((_) => backfillRoomTypeMarkers());
|
||||
_backfillSubscription = _clientStream.stream.listen(
|
||||
(_) => backfillRoomTypeMarkers(),
|
||||
);
|
||||
if (PlatformInfos.isMobile) {
|
||||
_callEventSubscription = FlutterCallkitIncoming.onEvent.listen(
|
||||
_onCallEvent,
|
||||
@@ -910,30 +911,7 @@ class ChatListController extends State<ChatList>
|
||||
bool waitForFirstSync = false;
|
||||
|
||||
/// Leaves the room locally and removes it from the local database.
|
||||
Future<void> leaveRoom(Room room) async {
|
||||
try {
|
||||
await room.leave();
|
||||
} on MatrixException catch (e, s) {
|
||||
// If the room was already left on the server (e.g. a stale local copy
|
||||
// reappeared after a restart) the leave request fails, but the user
|
||||
// intent (room not being listed anymore) is already fulfilled. Clean up
|
||||
// locally instead of showing an error.
|
||||
if (!{
|
||||
MatrixError.M_FORBIDDEN,
|
||||
MatrixError.M_NOT_FOUND,
|
||||
MatrixError.M_UNKNOWN,
|
||||
}.contains(e.error)) {
|
||||
Logs().w('Failed to leave room ${room.id}', e, s);
|
||||
rethrow;
|
||||
}
|
||||
Logs().w('Room ${room.id} is already gone, cleaning up locally...', e, s);
|
||||
}
|
||||
final client = room.client;
|
||||
// Make sure the room does not reappear from the local database after an
|
||||
// app restart, even if the leave sync did not run in time.
|
||||
await client.database.forgetRoom(room.id);
|
||||
client.rooms.remove(room);
|
||||
}
|
||||
Future<void> leaveRoom(Room room) => safeLeave(room);
|
||||
|
||||
/// Loads the shared [roomTypeStateEvent] marker from the synced room state
|
||||
/// (from the local database for partially loaded rooms) and writes it for
|
||||
|
||||
Reference in New Issue
Block a user