mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-23 08:27:30 +00:00
Don't shorten ttl of closedGroupControlMessage
This commit is contained in:
parent
f5121770ec
commit
39df560f0c
@ -252,19 +252,18 @@ object MessageSender {
|
|||||||
return promise
|
return promise
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getSpecifiedTtl(message: Message, isSyncMessage: Boolean): Long? {
|
private fun getSpecifiedTtl(
|
||||||
val storage = MessagingModuleConfiguration.shared.storage
|
message: Message,
|
||||||
val threadId = message.threadID
|
isSyncMessage: Boolean
|
||||||
?: run {
|
): Long? = message.takeUnless { it is ClosedGroupControlMessage }?.run {
|
||||||
val address = if (isSyncMessage && message is VisibleMessage) message.syncTarget else message.recipient
|
threadID ?: (if (isSyncMessage && this is VisibleMessage) syncTarget else recipient)
|
||||||
storage.getThreadId(Address.fromSerialized(address!!)) ?: return null
|
?.let(Address.Companion::fromSerialized)
|
||||||
}
|
?.let(MessagingModuleConfiguration.shared.storage::getThreadId)
|
||||||
val config = storage.getExpirationConfiguration(threadId)?.takeIf { it.isEnabled } ?: return null
|
}?.let(MessagingModuleConfiguration.shared.storage::getExpirationConfiguration)
|
||||||
val expiryMode = config.expiryMode
|
?.takeIf { it.isEnabled }
|
||||||
return if (expiryMode is ExpiryMode.AfterSend || isSyncMessage) {
|
?.expiryMode
|
||||||
expiryMode.expiryMillis
|
?.takeIf { it is ExpiryMode.AfterSend || isSyncMessage }
|
||||||
} else null
|
?.expiryMillis
|
||||||
}
|
|
||||||
|
|
||||||
// Open Groups
|
// Open Groups
|
||||||
private fun sendToOpenGroupDestination(destination: Destination, message: Message): Promise<Unit, Exception> {
|
private fun sendToOpenGroupDestination(destination: Destination, message: Message): Promise<Unit, Exception> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user