Skip to content

Commit e78feb0

Browse files
committed
Don’t restore groups during registration
1 parent d9d5b83 commit e78feb0

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

SignalServiceKit/Groups/GroupsV2Impl+RestoreGroups.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public extension GroupsV2Impl {
105105
private static func isRegisteredWithSneakyTransaction(authedAccount: AuthedAccount) -> Bool {
106106
switch authedAccount.info {
107107
case .explicit:
108-
return true
108+
return false
109109
case .implicit:
110110
return DependenciesBridge.shared.tsAccountManager.registrationStateWithMaybeSneakyTransaction.isRegistered
111111
}

SignalServiceKit/Groups/GroupsV2Impl.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ public class GroupsV2Impl: GroupsV2 {
7676
name: .OWSApplicationDidBecomeActive,
7777
object: nil
7878
)
79+
NotificationCenter.default.addObserver(
80+
self,
81+
selector: #selector(registrationStateDidChange),
82+
name: .registrationStateDidChange,
83+
object: nil,
84+
)
7985
}
8086

8187
@objc
@@ -92,6 +98,13 @@ public class GroupsV2Impl: GroupsV2 {
9298
Self.enqueueRestoreGroupPass(authedAccount: .implicit())
9399
}
94100

101+
@objc
102+
private func registrationStateDidChange() {
103+
AssertIsOnMainThread()
104+
105+
Self.enqueueRestoreGroupPass(authedAccount: .implicit())
106+
}
107+
95108
// MARK: - Create Group
96109

97110
public func createNewGroupOnService(

0 commit comments

Comments
 (0)