mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-23 00:17:34 +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.ThreadRecord
|
||||
import org.thoughtcrime.securesms.dependencies.ConfigFactory
|
||||
import org.thoughtcrime.securesms.dependencies.DatabaseComponent
|
||||
import javax.inject.Inject
|
||||
import kotlin.coroutines.resume
|
||||
import kotlin.coroutines.resumeWithException
|
||||
@ -149,11 +150,12 @@ class DefaultConversationRepository @Inject constructor(
|
||||
for (contact in contacts) {
|
||||
val message = VisibleMessage()
|
||||
message.sentTimestamp = SnodeAPI.nowWithOffset
|
||||
val openGroupInvitation = OpenGroupInvitation()
|
||||
openGroupInvitation.name = openGroup.name
|
||||
openGroupInvitation.url = openGroup.joinURL
|
||||
val openGroupInvitation = OpenGroupInvitation().apply {
|
||||
name = openGroup.name
|
||||
url = openGroup.joinURL
|
||||
}
|
||||
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 expireStartedAt = if (expirationConfig?.expiryMode is ExpiryMode.AfterSend) message.sentTimestamp!! else 0
|
||||
val outgoingTextMessage = OutgoingTextMessage.fromOpenGroupInvitation(
|
||||
|
Loading…
x
Reference in New Issue
Block a user