Don't notify for closed group control messages

This addresses an issue where:

• someone would create a closed group
• on other peoples' devices this control message would be received through a background poll or a push notification
• the received message timestamps table would be updated
• processing wouldn't be finished (during a background poll or while handling a push notification the system can cut you off at any time)
• some of the added users don't see the new closed group because when they open the app and get the control message from their swarm it's considered a duplicate and isn't processed again
This commit is contained in:
Niels Andriesse 2021-05-24 08:53:27 +10:00
parent 01b86fcc2f
commit 66e7df22bb
2 changed files with 3 additions and 1 deletions

View File

@ -163,9 +163,11 @@ object MessageSender {
}
handleSuccessfulMessageSend(message, destination, isSyncMessage)
var shouldNotify = (message is VisibleMessage && !isSyncMessage)
/*
if (message is ClosedGroupControlMessage && message.kind is ClosedGroupControlMessage.Kind.New) {
shouldNotify = true
}
*/
if (shouldNotify) {
val notifyPNServerJob = NotifyPNServerJob(snodeMessage)
JobQueue.shared.add(notifyPNServerJob)

View File

@ -28,7 +28,7 @@ class ClosedGroupPollerV2 {
companion object {
private val minPollInterval = 4 * 1000
private val maxPollInterval = 2 * 60 * 1000
private val maxPollInterval = 4 * 60 * 1000
@JvmStatic
val shared = ClosedGroupPollerV2()