removing non common properties form the base event
This commit is contained in:
parent
67211605aa
commit
51f7dee952
@ -18,19 +18,19 @@ package im.vector.app.features.notifications
|
||||
import androidx.core.app.NotificationCompat
|
||||
|
||||
data class InviteNotifiableEvent(
|
||||
override var matrixID: String?,
|
||||
var matrixID: String?,
|
||||
override val eventId: String,
|
||||
override val editedEventId: String?,
|
||||
var roomId: String,
|
||||
override var noisy: Boolean,
|
||||
override val title: String,
|
||||
override val description: String,
|
||||
override val type: String?,
|
||||
override val timestamp: Long,
|
||||
override var soundName: String?,
|
||||
val title: String,
|
||||
val description: String,
|
||||
val type: String?,
|
||||
val timestamp: Long,
|
||||
var soundName: String?,
|
||||
override var isPushGatewayEvent: Boolean = false) : NotifiableEvent {
|
||||
|
||||
override var hasBeenDisplayed: Boolean = false
|
||||
override var isRedacted: Boolean = false
|
||||
override var lockScreenVisibility = NotificationCompat.VISIBILITY_PUBLIC
|
||||
override var hasBeenDisplayed = false
|
||||
}
|
||||
|
@ -21,20 +21,13 @@ import java.io.Serializable
|
||||
* Parent interface for all events which can be displayed as a Notification
|
||||
*/
|
||||
interface NotifiableEvent : Serializable {
|
||||
var matrixID: String?
|
||||
val eventId: String
|
||||
val editedEventId: String?
|
||||
var noisy: Boolean
|
||||
val title: String
|
||||
val description: String?
|
||||
val type: String?
|
||||
val timestamp: Long
|
||||
|
||||
// NotificationCompat.VISIBILITY_PUBLIC , VISIBILITY_PRIVATE , VISIBILITY_SECRET
|
||||
var lockScreenVisibility: Int
|
||||
|
||||
// Compat: Only for android <7, for newer version the sound is defined in the channel
|
||||
var soundName: String?
|
||||
var hasBeenDisplayed: Boolean
|
||||
var isRedacted: Boolean
|
||||
|
||||
|
@ -22,7 +22,7 @@ data class NotifiableMessageEvent(
|
||||
override val eventId: String,
|
||||
override val editedEventId: String?,
|
||||
override var noisy: Boolean,
|
||||
override val timestamp: Long,
|
||||
val timestamp: Long,
|
||||
var senderName: String?,
|
||||
var senderId: String?,
|
||||
var body: String?,
|
||||
@ -31,8 +31,8 @@ data class NotifiableMessageEvent(
|
||||
var roomIsDirect: Boolean = false
|
||||
) : NotifiableEvent {
|
||||
|
||||
override var matrixID: String? = null
|
||||
override var soundName: String? = null
|
||||
var matrixID: String? = null
|
||||
var soundName: String? = null
|
||||
override var lockScreenVisibility = NotificationCompat.VISIBILITY_PUBLIC
|
||||
override var hasBeenDisplayed: Boolean = false
|
||||
override var isRedacted: Boolean = false
|
||||
@ -42,14 +42,12 @@ data class NotifiableMessageEvent(
|
||||
|
||||
override var isPushGatewayEvent: Boolean = false
|
||||
|
||||
override val type: String
|
||||
get() = EventType.MESSAGE
|
||||
val type: String = EventType.MESSAGE
|
||||
|
||||
override val description: String?
|
||||
val description: String
|
||||
get() = body ?: ""
|
||||
|
||||
override val title: String
|
||||
get() = senderName ?: ""
|
||||
val title: String = senderName ?: ""
|
||||
|
||||
// This is used for >N notification, as the result of a smart reply
|
||||
var outGoingMessage = false
|
||||
|
@ -395,7 +395,7 @@ class NotificationDrawerManager @Inject constructor(private val context: Context
|
||||
textStyle = "bold"
|
||||
+String.format("%s: ", event.senderName)
|
||||
}
|
||||
+(event.description ?: "")
|
||||
+(event.description)
|
||||
}
|
||||
summaryInboxStyle.addLine(line)
|
||||
} else {
|
||||
@ -404,7 +404,7 @@ class NotificationDrawerManager @Inject constructor(private val context: Context
|
||||
textStyle = "bold"
|
||||
+String.format("%s: %s ", roomName, event.senderName)
|
||||
}
|
||||
+(event.description ?: "")
|
||||
+(event.description)
|
||||
}
|
||||
summaryInboxStyle.addLine(line)
|
||||
}
|
||||
|
@ -18,15 +18,15 @@ package im.vector.app.features.notifications
|
||||
import androidx.core.app.NotificationCompat
|
||||
|
||||
data class SimpleNotifiableEvent(
|
||||
override var matrixID: String?,
|
||||
var matrixID: String?,
|
||||
override val eventId: String,
|
||||
override val editedEventId: String?,
|
||||
override var noisy: Boolean,
|
||||
override val title: String,
|
||||
override val description: String,
|
||||
override val type: String?,
|
||||
override val timestamp: Long,
|
||||
override var soundName: String?,
|
||||
val title: String,
|
||||
val description: String,
|
||||
val type: String?,
|
||||
val timestamp: Long,
|
||||
var soundName: String?,
|
||||
override var isPushGatewayEvent: Boolean = false) : NotifiableEvent {
|
||||
|
||||
override var hasBeenDisplayed: Boolean = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user