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.
This commit is contained in:
parent
e8f979ec96
commit
a21ead8cd5
|
|
@ -1644,7 +1644,6 @@ class Room {
|
||||||
requestUser(
|
requestUser(
|
||||||
mxID,
|
mxID,
|
||||||
ignoreErrors: true,
|
ignoreErrors: true,
|
||||||
requestProfile: false,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return User(mxID, room: this);
|
return User(mxID, room: this);
|
||||||
|
|
@ -1702,13 +1701,17 @@ class Room {
|
||||||
try {
|
try {
|
||||||
final profile = await client.getUserProfile(mxID);
|
final profile = await client.getUserProfile(mxID);
|
||||||
_requestingMatrixIds.remove(mxID);
|
_requestingMatrixIds.remove(mxID);
|
||||||
return User(
|
final user = User(
|
||||||
mxID,
|
mxID,
|
||||||
displayName: profile.displayname,
|
displayName: profile.displayname,
|
||||||
avatarUrl: profile.avatarUrl?.toString(),
|
avatarUrl: profile.avatarUrl?.toString(),
|
||||||
membership: Membership.leave.name,
|
membership: Membership.leave.name,
|
||||||
room: this,
|
room: this,
|
||||||
);
|
);
|
||||||
|
// Set it as temporary state but do not store in database:
|
||||||
|
setState(user);
|
||||||
|
onUpdate.add(id);
|
||||||
|
return user;
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
_requestingMatrixIds.remove(mxID);
|
_requestingMatrixIds.remove(mxID);
|
||||||
if (!ignoreErrors) {
|
if (!ignoreErrors) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue