From a21ead8cd58ab71b88f0785386b7c10257ae8f85 Mon Sep 17 00:00:00 2001 From: Krille Date: Tue, 21 May 2024 14:38:21 +0200 Subject: [PATCH] fix: Requst profiles for left users This has been set to false to prevent storing global user profiles as member states in the database. However looks like this is already solved below. We can safely store the profile in the local cache, otherwise we cannot calc the body for an event synchroniously. --- lib/src/room.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/src/room.dart b/lib/src/room.dart index e26672fd..ba622900 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -1644,7 +1644,6 @@ class Room { requestUser( mxID, ignoreErrors: true, - requestProfile: false, ); } return User(mxID, room: this); @@ -1702,13 +1701,17 @@ class Room { try { final profile = await client.getUserProfile(mxID); _requestingMatrixIds.remove(mxID); - return User( + final user = User( mxID, displayName: profile.displayname, avatarUrl: profile.avatarUrl?.toString(), membership: Membership.leave.name, room: this, ); + // Set it as temporary state but do not store in database: + setState(user); + onUpdate.add(id); + return user; } catch (e, s) { _requestingMatrixIds.remove(mxID); if (!ignoreErrors) {