Fixed onNotifyReceived callback prototype, a parameter is now nullable (SDK change)

This commit is contained in:
Sylvain Berfini 2023-12-20 08:51:45 +01:00
parent b438090092
commit 01b622decc

View file

@ -54,9 +54,9 @@ open class StatusViewModel : ViewModel() {
core: Core, core: Core,
event: Event, event: Event,
notifiedEvent: String, notifiedEvent: String,
body: Content body: Content?
) { ) {
if (body.type == "application" && body.subtype == "simple-message-summary" && body.size > 0) { if (body?.type == "application" && body.subtype == "simple-message-summary" && body.size > 0) {
val data = body.utf8Text?.lowercase(Locale.getDefault()) val data = body.utf8Text?.lowercase(Locale.getDefault())
val voiceMail = data?.split("voice-message: ") val voiceMail = data?.split("voice-message: ")
if ((voiceMail?.size ?: 0) >= 2) { if ((voiceMail?.size ?: 0) >= 2) {