mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-28 04:25:18 +00:00
Start disappearing after sent
This commit is contained in:
parent
92b30739f0
commit
7d25fd9f4c
@ -554,7 +554,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
|||||||
val recipient = viewModel.recipient ?: return
|
val recipient = viewModel.recipient ?: return
|
||||||
if (viewModel.recipient?.disappearingState == DisappearingState.LEGACY &&
|
if (viewModel.recipient?.disappearingState == DisappearingState.LEGACY &&
|
||||||
viewModel.expirationConfiguration?.isEnabled == true &&
|
viewModel.expirationConfiguration?.isEnabled == true &&
|
||||||
!ExpirationConfiguration.isNewConfigEnabled
|
ExpirationConfiguration.isNewConfigEnabled
|
||||||
) {
|
) {
|
||||||
binding?.outdatedBannerTextView?.text =
|
binding?.outdatedBannerTextView?.text =
|
||||||
resources.getString(R.string.activity_conversation_outdated_client_banner_text, recipient.name)
|
resources.getString(R.string.activity_conversation_outdated_client_banner_text, recipient.name)
|
||||||
|
@ -161,7 +161,7 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
|
|||||||
val expirationConfig = getExpirationConfiguration(message.threadID ?: -1)
|
val expirationConfig = getExpirationConfiguration(message.threadID ?: -1)
|
||||||
val expiresIn = expirationConfig?.durationSeconds ?: 0
|
val expiresIn = expirationConfig?.durationSeconds ?: 0
|
||||||
val expireStartedAt = if (expirationConfig?.expirationType == ExpirationType.DELETE_AFTER_SEND) {
|
val expireStartedAt = if (expirationConfig?.expirationType == ExpirationType.DELETE_AFTER_SEND) {
|
||||||
message.sentTimestamp!! + (expirationConfig.durationSeconds * 1000L)
|
message.sentTimestamp!! + (expiresIn * 1000L)
|
||||||
} else 0
|
} else 0
|
||||||
if (message.isMediaMessage() || attachments.isNotEmpty()) {
|
if (message.isMediaMessage() || attachments.isNotEmpty()) {
|
||||||
val quote: Optional<QuoteModel> = if (quotes != null) Optional.of(quotes) else Optional.absent()
|
val quote: Optional<QuoteModel> = if (quotes != null) Optional.of(quotes) else Optional.absent()
|
||||||
@ -212,6 +212,7 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
|
|||||||
DatabaseComponent.get(context).lokiMessageDatabase().setMessageServerHash(id, serverHash)
|
DatabaseComponent.get(context).lokiMessageDatabase().setMessageServerHash(id, serverHash)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
SSKEnvironment.shared.messageExpirationManager.startAnyExpiration(message.sentTimestamp!!, message.sender!!, expireStartedAt)
|
||||||
return messageID
|
return messageID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user