Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

Commit 830e7c4

Browse files
authored
Merge pull request #2373 from RocketChat/release/3.1.2
[RELEASE] Merge release 3.1.2 into MASTER
2 parents 64b4ae9 + a137f12 commit 830e7c4

File tree

4 files changed

+1
-53
lines changed

4 files changed

+1
-53
lines changed

Rocket.Chat/AppDelegate.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
3333
AuthManager.persistAuthInformation(auth)
3434
AuthSettingsManager.shared.updateCachedSettings()
3535
WindowManager.open(.subscriptions)
36-
37-
if let user = auth.user {
38-
AnalyticsCoordinator.identifyCrashReports(withUser: user)
39-
}
4036
} else {
4137
WindowManager.open(.auth(serverUrl: "", credentials: nil))
4238
}

Rocket.Chat/Managers/AppManager.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,6 @@ extension AppManager {
190190
SocketManager.disconnect { (_, _) in
191191
DispatchQueue.main.async {
192192
if AuthManager.isAuthenticated() != nil {
193-
if let currentUser = AuthManager.currentUser() {
194-
AnalyticsCoordinator.identifyCrashReports(withUser: currentUser)
195-
}
196-
197193
WindowManager.open(.subscriptions)
198194

199195
let server = AuthManager.selectedServerHost()

Rocket.Chat/Managers/Launcher/AnalyticsCoordinator.swift

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ struct AnalyticsCoordinator: LauncherProtocol {
2424
static func toggleCrashReporting(disabled: Bool) {
2525
UserDefaults.standard.set(disabled, forKey: kCrashReportingDisabledKey)
2626

27-
if disabled {
28-
anonymizeCrashReports()
29-
} else {
27+
if !disabled {
3028
AnalyticsCoordinator().prepareToLaunch(with: nil)
3129
}
3230
}
@@ -57,45 +55,5 @@ struct AnalyticsCoordinator: LauncherProtocol {
5755

5856
private func launchFabric() {
5957
Fabric.with([Crashlytics.self])
60-
61-
if let currentUser = AuthManager.currentUser() {
62-
AnalyticsCoordinator.identifyCrashReports(withUser: currentUser)
63-
} else {
64-
AnalyticsCoordinator.anonymizeCrashReports()
65-
}
66-
}
67-
68-
static func identifyCrashReports(withUser user: User) {
69-
guard let id = user.identifier else {
70-
return
71-
}
72-
73-
let crashlytics = Crashlytics.sharedInstance()
74-
crashlytics.setUserIdentifier(id)
75-
76-
if let name = user.name {
77-
crashlytics.setUserName(name)
78-
}
79-
80-
if let email = user.emails.first?.email {
81-
crashlytics.setUserEmail(email)
82-
}
83-
84-
if let serverURL = AuthManager.selectedServerInformation()?[ServerPersistKeys.serverURL] {
85-
crashlytics.setObjectValue(serverURL, forKey: ServerPersistKeys.serverURL)
86-
}
87-
88-
if let serverVersion = AuthManager.selectedServerInformation()?[ServerPersistKeys.serverVersion] {
89-
crashlytics.setObjectValue(serverVersion, forKey: ServerPersistKeys.serverVersion)
90-
}
91-
}
92-
93-
static func anonymizeCrashReports() {
94-
let crashlytics = Crashlytics.sharedInstance()
95-
96-
crashlytics.setUserEmail(nil)
97-
crashlytics.setUserName(nil)
98-
crashlytics.setUserIdentifier(nil)
99-
crashlytics.setObjectValue(nil, forKey: ServerPersistKeys.serverURL)
10058
}
10159
}

Rocket.Chat/Managers/Model/AuthManager/AuthManagerSocket.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ extension AuthManager {
257257
*/
258258
static func logout(completion: @escaping VoidCompletion) {
259259
SocketManager.disconnect { (_, _) in
260-
AnalyticsCoordinator.anonymizeCrashReports()
261-
262260
DraftMessageManager.clearServerDraftMessages()
263261

264262
Realm.executeOnMainThread({ (realm) in

0 commit comments

Comments
 (0)