Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ internal class MessagesActivity :
}

override fun onResume() {
Logger.info("OnResume " + javaClass.simpleName)
val context = applicationContext
val nManager = context.getSystemService(NOTIFICATION_SERVICE) as NotificationManager
nManager.cancelAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.github.gotify.messages.provider
import com.github.gotify.client.model.Message
import com.github.gotify.client.model.PagedMessages
import kotlin.math.max
import org.tinylog.kotlin.Logger

internal class MessageStateHolder {
@get:Synchronized
Expand Down Expand Up @@ -42,6 +43,12 @@ internal class MessageStateHolder {

@Synchronized
fun newMessage(message: Message) {
if (lastReceivedMessage >= message.id) {
Logger.warn {
"Skipping processing message with id ${message.id} as it's already processed (lastReceivedMessage: $lastReceivedMessage)"
}
return
}
// If there is a message with pending deletion, its indices are going to change. To keep
// them consistent the deletion is undone first and redone again after adding the new
// message.
Expand Down
Loading