1
0
mirror of https://github.com/vector-im/riotX-android synced 2025-10-05 15:52:47 +02:00

Render incoming Element Call in the notification (unsupported)

This commit is contained in:
Benoit Marty
2024-11-12 15:12:53 +01:00
parent 066545a4b3
commit 6e2a0cfa91
8 changed files with 28 additions and 3 deletions

View File

@@ -499,7 +499,11 @@ fun Event.getPollContent(): MessagePollContent? {
}
fun Event.supportsNotification() =
this.getClearType() in EventType.MESSAGE + EventType.POLL_START.values + EventType.POLL_END.values + EventType.STATE_ROOM_BEACON_INFO.values
this.getClearType() in EventType.MESSAGE +
EventType.POLL_START.values +
EventType.POLL_END.values +
EventType.STATE_ROOM_BEACON_INFO.values +
EventType.ELEMENT_CALL_NOTIFY.values
fun Event.isContentReportable() =
this.getClearType() in EventType.MESSAGE + EventType.STATE_ROOM_BEACON_INFO.values

View File

@@ -32,3 +32,8 @@ data class Mentions(
@Json(name = "room") val room: Boolean? = null,
@Json(name = "user_ids") val userIds: List<String>? = null,
)
fun ElementCallNotifyContent.isUserMentioned(userId: String): Boolean {
return mentions?.room == true ||
mentions?.userIds?.contains(userId) == true
}

View File

@@ -61,6 +61,7 @@ internal class DefaultProcessEventForPushTask @Inject constructor(
in EventType.POLL_START.values,
in EventType.POLL_END.values,
in EventType.STATE_ROOM_BEACON_INFO.values,
in EventType.ELEMENT_CALL_NOTIFY.values,
EventType.MESSAGE,
EventType.REDACTION,
EventType.ENCRYPTED,