Added the legacy group 'joined_at' value

This commit is contained in:
Morgan Pretty
2023-06-01 15:25:58 +10:00
parent 422f53c86a
commit 3a035482e4
4 changed files with 17 additions and 6 deletions

View File

@@ -564,7 +564,7 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
val admins = group.members.filter { it.value /*admin = true*/ }.keys.map { Address.fromSerialized(it) }
val groupId = GroupUtil.doubleEncodeGroupID(group.sessionId)
val title = group.name
val formationTimestamp = SnodeAPI.nowWithOffset // TODO: formation timestamp for legacy ? current time?
val formationTimestamp = group.joinedAt
createGroup(groupId, title, members, null, null, admins, formationTimestamp)
setProfileSharing(Address.fromSerialized(groupId), true)
// Add the group to the user's set of public keys to poll for
@@ -835,7 +835,8 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
priority = ConfigBase.PRIORITY_VISIBLE,
encPubKey = encryptionKeyPair.publicKey.serialize(),
encSecKey = encryptionKeyPair.privateKey.serialize(),
disappearingTimer = 0L
disappearingTimer = 0L,
joinedAt = formationTimestamp
)
// shouldn't exist, don't use getOrConstruct + copy
userGroups.set(groupInfo)

View File

@@ -256,7 +256,8 @@ object ConfigurationMessageUtilities {
priority = if (isPinned) ConfigBase.PRIORITY_PINNED else ConfigBase.PRIORITY_VISIBLE,
encPubKey = encryptionKeyPair.publicKey.serialize(),
encSecKey = encryptionKeyPair.privateKey.serialize(),
disappearingTimer = recipient.expireMessages.toLong()
disappearingTimer = recipient.expireMessages.toLong(),
joinedAt = group.formationTimestamp
)
}
(allOpenGroups + allLgc).forEach { groupInfo ->