change icon in message from object to string

This commit is contained in:
Hunter Kehoe 2022-07-17 15:40:51 -06:00
parent ecefdd3df6
commit 12bd524cbd
2 changed files with 8 additions and 15 deletions

View file

@ -13,7 +13,7 @@ data class Message(
val priority: Int?,
val tags: List<String>?,
val click: String?,
val icon: MessageIcon?,
val icon: String?,
val actions: List<MessageAction>?,
val title: String?,
val message: String,
@ -44,11 +44,4 @@ data class MessageAction(
val extras: Map<String,String>?, // used in "broadcast" action
)
@Keep
data class MessageIcon(
val url: String,
val type: String?,
val size: Long?,
)
const val MESSAGE_ENCODING_BASE64 = "base64"

View file

@ -32,13 +32,6 @@ class NotificationParser {
url = message.attachment.url,
)
} else null
val icon = if (message.icon?.url != null) {
Icon(
url = message.icon.url,
type = message.icon.type,
size = message.icon.size,
)
} else null
val actions = if (message.actions != null) {
message.actions.map { a ->
Action(
@ -57,6 +50,13 @@ class NotificationParser {
)
}
} else null
val icon: Icon? = if (message.icon != null) {
Icon(
url = message.icon,
size = null,
type = null
)
} else null
val notification = Notification(
id = message.id,
subscriptionId = subscriptionId,