mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
Fix timestamps
This commit is contained in:
parent
8145a7d772
commit
019a86482a
@ -1715,6 +1715,11 @@ open class Storage(
|
|||||||
|
|
||||||
override fun setExpirationConfiguration(config: ExpirationConfiguration) {
|
override fun setExpirationConfiguration(config: ExpirationConfiguration) {
|
||||||
val recipient = getRecipientForThread(config.threadId) ?: return
|
val recipient = getRecipientForThread(config.threadId) ?: return
|
||||||
|
|
||||||
|
val expirationDb = DatabaseComponent.get(context).expirationConfigurationDatabase()
|
||||||
|
val currentConfig = expirationDb.getExpirationConfiguration(config.threadId)
|
||||||
|
if (currentConfig != null && currentConfig.updatedTimestampMs >= config.updatedTimestampMs) return
|
||||||
|
|
||||||
if (recipient.isClosedGroupRecipient) {
|
if (recipient.isClosedGroupRecipient) {
|
||||||
val userGroups = configFactory.userGroups ?: return
|
val userGroups = configFactory.userGroups ?: return
|
||||||
val groupPublicKey = GroupUtil.addressToGroupSessionId(recipient.address)
|
val groupPublicKey = GroupUtil.addressToGroupSessionId(recipient.address)
|
||||||
@ -1732,7 +1737,7 @@ open class Storage(
|
|||||||
) ?: return
|
) ?: return
|
||||||
contacts.set(contact)
|
contacts.set(contact)
|
||||||
}
|
}
|
||||||
DatabaseComponent.get(context).expirationConfigurationDatabase().setExpirationConfiguration(config)
|
expirationDb.setExpirationConfiguration(config)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getExpiringMessages(messageIds: List<Long>): List<Pair<Long, Long>> {
|
override fun getExpiringMessages(messageIds: List<Long>): List<Pair<Long, Long>> {
|
||||||
|
@ -172,7 +172,7 @@ private fun MessageReceiver.handleExpirationTimerUpdate(message: ExpirationTimer
|
|||||||
ExpirationConfiguration(
|
ExpirationConfiguration(
|
||||||
threadId,
|
threadId,
|
||||||
type,
|
type,
|
||||||
SnodeAPI.nowWithOffset
|
message.sentTimestamp!!
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user