Skip to content

Commit 75167fe

Browse files
committed
Properly validate notification type
1 parent 3b397ee commit 75167fe

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.idea/deploymentTargetSelector.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composeApp/src/androidMain/kotlin/com/hypergonial/chat/MessagingService.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ class MessagingService : FirebaseMessagingService() {
3737
Logger.withTag("NotifierManager").i(it)
3838
}
3939

40-
notificationProvider.sendNotification {
41-
channelId = message.data["channel_id"]?.toSnowflake()
42-
title = message.data["title"] ?: "You got mail!"
43-
body = message.data["body"] ?: "No content provided."
44-
payloadData = message.data
40+
if (message.data["type"] == "notification") {
41+
notificationProvider.sendNotification {
42+
channelId = message.data["channel_id"]?.toSnowflake()
43+
title = message.data["title"] ?: "You got mail!"
44+
body = message.data["body"] ?: "No content provided."
45+
payloadData = message.data
46+
}
4547
}
4648
}
4749
}

0 commit comments

Comments
 (0)