mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 01:19:33 +00:00
refactor: rename CallNotify to RtcNotification to match new event
This commit is contained in:
+3
-3
@@ -49,9 +49,9 @@ sealed interface NotificationContent {
|
||||
val senderId: UserId,
|
||||
) : MessageLike
|
||||
|
||||
data class CallNotify(
|
||||
data class RtcNotification(
|
||||
val senderId: UserId,
|
||||
val type: CallNotifyType,
|
||||
val type: RtcNotificationType,
|
||||
val expirationTimestampMillis: Long
|
||||
) : MessageLike
|
||||
|
||||
@@ -119,7 +119,7 @@ sealed interface NotificationContent {
|
||||
) : NotificationContent
|
||||
}
|
||||
|
||||
enum class CallNotifyType {
|
||||
enum class RtcNotificationType {
|
||||
RING,
|
||||
NOTIFY
|
||||
}
|
||||
|
||||
+5
-5
@@ -10,7 +10,7 @@ package io.element.android.libraries.matrix.impl.notification
|
||||
import io.element.android.libraries.core.extensions.runCatchingExceptions
|
||||
import io.element.android.libraries.matrix.api.core.EventId
|
||||
import io.element.android.libraries.matrix.api.core.UserId
|
||||
import io.element.android.libraries.matrix.api.notification.CallNotifyType
|
||||
import io.element.android.libraries.matrix.api.notification.RtcNotificationType
|
||||
import io.element.android.libraries.matrix.api.notification.NotificationContent
|
||||
import io.element.android.libraries.matrix.impl.room.member.RoomMemberMapper
|
||||
import io.element.android.libraries.matrix.impl.timeline.item.event.EventMessageMapper
|
||||
@@ -78,7 +78,7 @@ private fun MessageLikeEventContent.toContent(senderId: UserId): NotificationCon
|
||||
MessageLikeEventContent.CallCandidates -> NotificationContent.MessageLike.CallCandidates
|
||||
MessageLikeEventContent.CallHangup -> NotificationContent.MessageLike.CallHangup
|
||||
MessageLikeEventContent.CallInvite -> NotificationContent.MessageLike.CallInvite(senderId)
|
||||
is MessageLikeEventContent.RtcNotification -> NotificationContent.MessageLike.CallNotify(
|
||||
is MessageLikeEventContent.RtcNotification -> NotificationContent.MessageLike.RtcNotification(
|
||||
senderId = senderId,
|
||||
type = notificationType.map(),
|
||||
expirationTimestampMillis = expirationTs.toLong()
|
||||
@@ -105,7 +105,7 @@ private fun MessageLikeEventContent.toContent(senderId: UserId): NotificationCon
|
||||
}
|
||||
}
|
||||
|
||||
private fun RtcNotificationType.map(): CallNotifyType = when (this) {
|
||||
RtcNotificationType.NOTIFICATION -> CallNotifyType.NOTIFY
|
||||
RtcNotificationType.RING -> CallNotifyType.RING
|
||||
private fun RtcNotificationType.map(): RtcNotificationType = when (this) {
|
||||
RtcNotificationType.NOTIFICATION -> RtcNotificationType.NOTIFY
|
||||
RtcNotificationType.RING -> RtcNotificationType.RING
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user