From 5da842a109b84fd277646133d7bfb195b9410eb2 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Thu, 22 Aug 2024 11:25:02 +1000 Subject: [PATCH] Fixed an issue where joinedAt wasn't getting set for legacy groups --- Session.xcodeproj/project.pbxproj | 4 ++-- .../LibSession/Config Handling/LibSession+UserGroups.swift | 4 +++- .../Message Handling/MessageReceiver+ClosedGroups.swift | 1 + .../Message Handling/MessageSender+ClosedGroups.swift | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 855158aa9..9a6999ca6 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -7673,7 +7673,7 @@ CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 473; + CURRENT_PROJECT_VERSION = 474; ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -7751,7 +7751,7 @@ CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 473; + CURRENT_PROJECT_VERSION = 474; ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; diff --git a/SessionMessagingKit/LibSession/Config Handling/LibSession+UserGroups.swift b/SessionMessagingKit/LibSession/Config Handling/LibSession+UserGroups.swift index e86b44c3e..16074d698 100644 --- a/SessionMessagingKit/LibSession/Config Handling/LibSession+UserGroups.swift +++ b/SessionMessagingKit/LibSession/Config Handling/LibSession+UserGroups.swift @@ -625,6 +625,7 @@ public extension LibSession { _ db: Database, groupPublicKey: String, name: String, + joinedAt: TimeInterval, latestKeyPairPublicKey: Data, latestKeyPairSecretKey: Data, latestKeyPairReceivedTimestamp: TimeInterval, @@ -680,7 +681,8 @@ public extension LibSession { role: .admin, isHidden: false ) - } + }, + joinedAt: Int64(joinedAt) ) ], in: conf diff --git a/SessionMessagingKit/Sending & Receiving/Message Handling/MessageReceiver+ClosedGroups.swift b/SessionMessagingKit/Sending & Receiving/Message Handling/MessageReceiver+ClosedGroups.swift index ac2f3611a..79116401b 100644 --- a/SessionMessagingKit/Sending & Receiving/Message Handling/MessageReceiver+ClosedGroups.swift +++ b/SessionMessagingKit/Sending & Receiving/Message Handling/MessageReceiver+ClosedGroups.swift @@ -225,6 +225,7 @@ extension MessageReceiver { db, groupPublicKey: groupPublicKey, name: name, + joinedAt: (TimeInterval(formationTimestampMs) / 1000), latestKeyPairPublicKey: Data(encryptionKeyPair.publicKey), latestKeyPairSecretKey: Data(encryptionKeyPair.secretKey), latestKeyPairReceivedTimestamp: receivedTimestamp, diff --git a/SessionMessagingKit/Sending & Receiving/Message Handling/MessageSender+ClosedGroups.swift b/SessionMessagingKit/Sending & Receiving/Message Handling/MessageSender+ClosedGroups.swift index 694b579a8..7eddabef2 100644 --- a/SessionMessagingKit/Sending & Receiving/Message Handling/MessageSender+ClosedGroups.swift +++ b/SessionMessagingKit/Sending & Receiving/Message Handling/MessageSender+ClosedGroups.swift @@ -76,6 +76,7 @@ extension MessageSender { db, groupPublicKey: groupPublicKey, name: name, + joinedAt: formationTimestamp, latestKeyPairPublicKey: Data(encryptionKeyPair.publicKey), latestKeyPairSecretKey: Data(encryptionKeyPair.secretKey), latestKeyPairReceivedTimestamp: latestKeyPairReceivedTimestamp,