mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-06-05 21:49:22 +02:00
Minor code improvement
This commit is contained in:
@@ -170,7 +170,9 @@ class NotificationHelper(private val context: Context) {
|
|||||||
.setName(name)
|
.setName(name)
|
||||||
.setKey(address)
|
.setKey(address)
|
||||||
.build()
|
.build()
|
||||||
} else null
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
return NotificationCompat.MessagingStyle(user).also { style ->
|
return NotificationCompat.MessagingStyle(user).also { style ->
|
||||||
getOldMessages(notificationId).forEach {
|
getOldMessages(notificationId).forEach {
|
||||||
@@ -188,7 +190,7 @@ class NotificationHelper(private val context: Context) {
|
|||||||
val currentNotification = notificationManager.activeNotifications.find { it.id == notificationId }
|
val currentNotification = notificationManager.activeNotifications.find { it.id == notificationId }
|
||||||
return if (currentNotification != null) {
|
return if (currentNotification != null) {
|
||||||
val activeStyle = NotificationCompat.MessagingStyle.extractMessagingStyleFromNotification(currentNotification.notification)
|
val activeStyle = NotificationCompat.MessagingStyle.extractMessagingStyleFromNotification(currentNotification.notification)
|
||||||
return activeStyle?.messages.orEmpty()
|
activeStyle?.messages.orEmpty()
|
||||||
} else {
|
} else {
|
||||||
emptyList()
|
emptyList()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user