Do not fetch user if we do not have the previous content.

This commit is contained in:
Benoit Marty 2022-08-23 11:19:14 +02:00
parent 94a87744ac
commit e3f5d15eaf
1 changed files with 2 additions and 1 deletions

View File

@ -140,7 +140,8 @@ internal class RoomMemberEventHandler @Inject constructor(
val previousDisplayName = prevContent?.get("displayname") as? String
val previousAvatar = prevContent?.get("avatar_url") as? String
if (previousDisplayName != roomMember.displayName || previousAvatar != roomMember.avatarUrl) {
if ((previousDisplayName != null && previousDisplayName != roomMember.displayName) ||
(previousAvatar != null && previousAvatar != roomMember.avatarUrl)) {
aggregator.userIdsToFetch.add(eventUserId)
}
}