Checks the mentions for a valid Hex before creating users in the cache.

This commit is contained in:
Vitor Pamplona
2023-03-15 13:14:10 -04:00
parent a53bb53c12
commit a597bd7882

View File

@@ -297,7 +297,7 @@ fun NoteCompose(
if (noteEvent is TextNoteEvent && (note.replyTo != null || noteEvent.mentions().isNotEmpty())) {
val sortedMentions = noteEvent.mentions()
.map { LocalCache.getOrCreateUser(it) }
.mapNotNull { LocalCache.checkGetOrCreateUser(it) }
.toSet()
.sortedBy { account.userProfile().isFollowingCached(it) }
@@ -326,7 +326,7 @@ fun NoteCompose(
}
} else if (noteEvent is ChannelMessageEvent && (note.replyTo != null || noteEvent.mentions() != null)) {
val sortedMentions = noteEvent.mentions()
.map { LocalCache.getOrCreateUser(it) }
.mapNotNull { LocalCache.checkGetOrCreateUser(it) }
.toSet()
.sortedBy { account.userProfile().isFollowingCached(it) }