Skip to content

Commit

Permalink
checking if the event is an image message to avoid attepting to rende…
Browse files Browse the repository at this point in the history
…r non image based attachments
  • Loading branch information
ouchadam committed Nov 4, 2021
1 parent f3de057 commit 73a224e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import org.matrix.android.sdk.api.session.crypto.MXCryptoError
import org.matrix.android.sdk.api.session.events.model.Event
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.isEdition
import org.matrix.android.sdk.api.session.events.model.isImageMessage
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.model.Membership
import org.matrix.android.sdk.api.session.room.model.RoomMemberContent
Expand Down Expand Up @@ -202,7 +203,7 @@ class NotifiableEventResolver @Inject constructor(
private suspend fun TimelineEvent.fetchImageIfPresent(session: Session): Uri? {
return when {
root.isEncrypted() && root.mxDecryptionResult == null -> null
root.getClearType() == EventType.MESSAGE -> downloadAndExportImage(session)
root.isImageMessage() -> downloadAndExportImage(session)
else -> null
}
}
Expand Down

0 comments on commit 73a224e

Please sign in to comment.