fix: Do not store global profiles in room states as members

This commit is contained in:
Krille 2023-05-31 14:59:49 +02:00
parent 733f64b4ff
commit 85a21a6781
No known key found for this signature in database
1 changed files with 15 additions and 5 deletions

View File

@ -1598,7 +1598,13 @@ class Room {
if (user != null) { if (user != null) {
return user.asUser; return user.asUser;
} else { } else {
if (mxID.isValidMatrixId) requestUser(mxID, ignoreErrors: true); if (mxID.isValidMatrixId) {
requestUser(
mxID,
ignoreErrors: true,
requestProfile: false,
);
}
return User(mxID, room: this); return User(mxID, room: this);
} }
} }
@ -1652,10 +1658,14 @@ class Room {
if (resp == null && requestProfile) { if (resp == null && requestProfile) {
try { try {
final profile = await client.getUserProfile(mxID); final profile = await client.getUserProfile(mxID);
resp = { _requestingMatrixIds.remove(mxID);
'displayname': profile.displayname, return User(
'avatar_url': profile.avatarUrl.toString(), mxID,
}; displayName: profile.displayname,
avatarUrl: profile.avatarUrl?.toString(),
membership: Membership.leave.name,
room: this,
);
} catch (e, s) { } catch (e, s) {
_requestingMatrixIds.remove(mxID); _requestingMatrixIds.remove(mxID);
if (!ignoreErrors) { if (!ignoreErrors) {