mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-30 13:35:18 +00:00
Fix user's messages being ignored after re-joining open group
This commit is contained in:
parent
ceb46522a2
commit
f97f4d071d
@ -12,6 +12,7 @@ import org.thoughtcrime.securesms.database.Address
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory
|
||||
import org.thoughtcrime.securesms.jobs.PushDecryptJob
|
||||
import org.thoughtcrime.securesms.jobs.RetrieveProfileAvatarJob
|
||||
import org.thoughtcrime.securesms.loki.protocol.SessionMetaProtocol
|
||||
import org.thoughtcrime.securesms.loki.utilities.successBackground
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences
|
||||
@ -190,6 +191,7 @@ class PublicChatPoller(private val context: Context, private val group: PublicCh
|
||||
if (message.body.isEmpty() && message.attachments.isEmpty() && message.quote == null) { return }
|
||||
val userHexEncodedPublicKey = TextSecurePreferences.getLocalNumber(context)
|
||||
val dataMessage = getDataMessage(message)
|
||||
SessionMetaProtocol.dropFromTimestampCacheIfNeeded(dataMessage.timestamp)
|
||||
val transcript = SentTranscriptMessage(userHexEncodedPublicKey, dataMessage.timestamp, dataMessage, dataMessage.expiresInSeconds.toLong(), Collections.singletonMap(userHexEncodedPublicKey, false))
|
||||
transcript.messageServerID = messageServerID
|
||||
if (dataMessage.quote.isPresent || (dataMessage.attachments.isPresent && dataMessage.attachments.get().size > 0) || dataMessage.previews.isPresent) {
|
||||
|
@ -17,6 +17,11 @@ object SessionMetaProtocol {
|
||||
|
||||
private val timestamps = mutableSetOf<Long>()
|
||||
|
||||
@JvmStatic
|
||||
fun dropFromTimestampCacheIfNeeded(timestamp: Long) {
|
||||
timestamps.remove(timestamp)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun shouldIgnoreMessage(content: SignalServiceContent): Boolean {
|
||||
val timestamp = content.timestamp
|
||||
|
Loading…
Reference in New Issue
Block a user