Remove chat message notification when deleting chat room
This commit is contained in:
parent
e594c500f6
commit
f42b1c6a96
2 changed files with 11 additions and 0 deletions
|
@ -118,6 +118,7 @@ class ChatRoomsListViewModel : ErrorReportingViewModel() {
|
|||
|
||||
chatRoomsToDeleteCount = 1
|
||||
if (chatRoom != null) {
|
||||
coreContext.notificationsManager.dismissChatNotification(chatRoom)
|
||||
Compatibility.removeChatRoomShortcut(chatRoom)
|
||||
chatRoom.addListener(chatRoomListener)
|
||||
coreContext.core.deleteChatRoom(chatRoom)
|
||||
|
@ -131,6 +132,7 @@ class ChatRoomsListViewModel : ErrorReportingViewModel() {
|
|||
LinphoneUtils.deleteFilesAttachedToEventLog(eventLog)
|
||||
}
|
||||
|
||||
coreContext.notificationsManager.dismissChatNotification(chatRoom)
|
||||
Compatibility.removeChatRoomShortcut(chatRoom)
|
||||
chatRoom.addListener(chatRoomListener)
|
||||
chatRoom.core.deleteChatRoom(chatRoom)
|
||||
|
|
|
@ -602,6 +602,15 @@ class NotificationsManager(private val context: Context) {
|
|||
displayChatNotifiable(message.chatRoom, notifiable)
|
||||
}
|
||||
|
||||
fun dismissChatNotification(room: ChatRoom) {
|
||||
val address = room.peerAddress.asStringUriOnly()
|
||||
val notifiable: Notifiable? = chatNotificationsMap[address]
|
||||
if (notifiable != null) {
|
||||
Log.i("[Notifications Manager] Dismissing notification for chat room $room with id ${notifiable.notificationId}")
|
||||
cancel(notifiable.notificationId)
|
||||
}
|
||||
}
|
||||
|
||||
/* Notifications */
|
||||
|
||||
private fun createMessageNotification(
|
||||
|
|
Loading…
Reference in a new issue