mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-08 23:47:41 +00:00
Fix expiry not added to community invites
This commit is contained in:
parent
51f2c3557d
commit
22460df15e
@ -38,6 +38,7 @@ import org.thoughtcrime.securesms.database.ThreadDatabase
|
|||||||
import org.thoughtcrime.securesms.database.model.MessageRecord
|
import org.thoughtcrime.securesms.database.model.MessageRecord
|
||||||
import org.thoughtcrime.securesms.database.model.ThreadRecord
|
import org.thoughtcrime.securesms.database.model.ThreadRecord
|
||||||
import org.thoughtcrime.securesms.dependencies.ConfigFactory
|
import org.thoughtcrime.securesms.dependencies.ConfigFactory
|
||||||
|
import org.thoughtcrime.securesms.dependencies.DatabaseComponent
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import kotlin.coroutines.resume
|
import kotlin.coroutines.resume
|
||||||
import kotlin.coroutines.resumeWithException
|
import kotlin.coroutines.resumeWithException
|
||||||
@ -149,11 +150,12 @@ class DefaultConversationRepository @Inject constructor(
|
|||||||
for (contact in contacts) {
|
for (contact in contacts) {
|
||||||
val message = VisibleMessage()
|
val message = VisibleMessage()
|
||||||
message.sentTimestamp = SnodeAPI.nowWithOffset
|
message.sentTimestamp = SnodeAPI.nowWithOffset
|
||||||
val openGroupInvitation = OpenGroupInvitation()
|
val openGroupInvitation = OpenGroupInvitation().apply {
|
||||||
openGroupInvitation.name = openGroup.name
|
name = openGroup.name
|
||||||
openGroupInvitation.url = openGroup.joinURL
|
url = openGroup.joinURL
|
||||||
|
}
|
||||||
message.openGroupInvitation = openGroupInvitation
|
message.openGroupInvitation = openGroupInvitation
|
||||||
val expirationConfig = storage.getExpirationConfiguration(threadId)
|
val expirationConfig = DatabaseComponent.get(context).threadDatabase().getOrCreateThreadIdFor(contact).let(storage::getExpirationConfiguration)
|
||||||
val expiresInMillis = expirationConfig?.expiryMode?.expiryMillis ?: 0
|
val expiresInMillis = expirationConfig?.expiryMode?.expiryMillis ?: 0
|
||||||
val expireStartedAt = if (expirationConfig?.expiryMode is ExpiryMode.AfterSend) message.sentTimestamp!! else 0
|
val expireStartedAt = if (expirationConfig?.expiryMode is ExpiryMode.AfterSend) message.sentTimestamp!! else 0
|
||||||
val outgoingTextMessage = OutgoingTextMessage.fromOpenGroupInvitation(
|
val outgoingTextMessage = OutgoingTextMessage.fromOpenGroupInvitation(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user