Use MediaPreviewValue.Private to check if media should be displayed in notifications (#6038)

* Use `MediaPreviewValue.Private` to check if images should be displayed in notifications

Also added `NotificationData.roomJoinRule` so we can use it to check if the room is public or not

* Add logging message for cases when we should have an image uri it turns out we don't
This commit is contained in:
Jorge Martin Espinosa 2026-01-23 10:01:52 +01:00 committed by GitHub
parent 3f624c601c
commit 57e0b74482
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 5 deletions

View file

@ -18,6 +18,7 @@ import io.element.android.libraries.matrix.api.core.UserId
import io.element.android.libraries.matrix.api.notification.NotificationContent
import io.element.android.libraries.matrix.api.notification.NotificationData
import io.element.android.libraries.matrix.api.room.isDm
import io.element.android.libraries.matrix.impl.room.join.map
import io.element.android.services.toolbox.api.systemclock.SystemClock
import org.matrix.rustcomponents.sdk.NotificationEvent
import org.matrix.rustcomponents.sdk.NotificationItem
@ -59,6 +60,7 @@ class NotificationMapper(
timestamp = timestamp,
content = notificationContentMapper.map(item.event).getOrThrow(),
hasMention = item.hasMention.orFalse(),
roomJoinRule = item.roomInfo.joinRule?.map(),
)
}
}