Merge branch 'nico/fix-profile' into 'main'
fix: own profile containing mxid Closes frontend-issue-inbox#65 See merge request famedly/company/frontend/famedlysdk!975
This commit is contained in:
commit
8c8ab5e39a
|
|
@ -675,13 +675,15 @@ class Client extends MatrixApi {
|
||||||
if (rooms.isNotEmpty) {
|
if (rooms.isNotEmpty) {
|
||||||
final profileSet = <Profile>{};
|
final profileSet = <Profile>{};
|
||||||
for (final room in rooms) {
|
for (final room in rooms) {
|
||||||
final user = room.getUserByMXIDSync(userID!);
|
final user = await room.requestUser(userID!);
|
||||||
|
if (user != null) {
|
||||||
profileSet.add(Profile(
|
profileSet.add(Profile(
|
||||||
avatarUrl: user.avatarUrl,
|
avatarUrl: user.avatarUrl,
|
||||||
displayName: user.displayName,
|
displayName: user.displayName,
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (profileSet.length == 1) return profileSet.single;
|
if (profileSet.length == 1) return profileSet.single;
|
||||||
}
|
}
|
||||||
return getProfileFromUserId(userID!);
|
return getProfileFromUserId(userID!);
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue