fix cancel notification

This commit is contained in:
ryanzhao 2021-08-16 10:58:07 +10:00
parent f10ddb8e3a
commit feff1c8393
1 changed files with 4 additions and 4 deletions

View File

@ -156,14 +156,14 @@ fun MessageReceiver.handleUnsendRequest(message: UnsendRequest) {
val timestamp = message.timestamp ?: return
val author = message.author ?: return
val messageIdToDelete = storage.getMessageIdInDatabase(timestamp, author) ?: return
if (!messageDataProvider.isOutgoingMessage(messageIdToDelete)) {
// FIXME: Not sure if there is any performance issue here
SSKEnvironment.shared.notificationManager.updateNotification(context)
}
messageDataProvider.getServerHashForMessage(messageIdToDelete)?.let { serverHash ->
SnodeAPI.deleteMessage(author, listOf(serverHash))
}
messageDataProvider.updateMessageAsDeleted(timestamp, author)
if (!messageDataProvider.isOutgoingMessage(messageIdToDelete)) {
// FIXME: Not sure if there is any performance issue here
SSKEnvironment.shared.notificationManager.updateNotification(context)
}
}
//endregion