fix: open group sync persistence

This commit is contained in:
0x330a
2023-03-17 11:53:10 +11:00
parent 61e8935725
commit 2af0cc7bb2
3 changed files with 9 additions and 2 deletions

View File

@@ -18,7 +18,12 @@ class GroupAvatarDownloadJob(val server: String, val room: String, val imageId:
return
}
val storage = MessagingModuleConfiguration.shared.storage
val storedImageId = storage.getOpenGroup(room, server)?.imageId
val openGroup = storage.getOpenGroup(room, server)
if (openGroup == null) {
delegate?.handleJobFailedPermanently(this, dispatcherName, Exception("GroupAvatarDownloadJob openGroup is null"))
return
}
val storedImageId = openGroup.imageId
if (storedImageId == null || storedImageId != imageId) {
delegate?.handleJobFailedPermanently(this, dispatcherName, Exception("GroupAvatarDownloadJob imageId does not match the OpenGroup"))