From f3c36391b99d1c07e14413e1f162866389d78856 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Fri, 31 Jan 2020 16:02:30 +1100 Subject: [PATCH] Remove Mixpanel --- Signal/src/AppDelegate.m | 8 ------- .../AppSettings/AppSettingsViewController.m | 3 --- .../PrivacySettingsTableViewController.m | 22 ------------------- .../ViewControllers/ProfileViewController.m | 2 -- .../OnboardingSplashViewController.swift | 2 -- .../src/Loki/API/LokiAPI+SwarmAPI.swift | 1 - .../API/Public Chat/LokiPublicChatAPI.swift | 8 +------ 7 files changed, 1 insertion(+), 45 deletions(-) diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index f0331766c..76510c5ae 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -46,7 +46,6 @@ #import #import #import -#import #import @import WebRTC; @@ -355,12 +354,6 @@ static NSTimeInterval launchStartedAt; // NSLog(@"[Loki] Failed to start P2P server."); // } - // Loki - Set up beta analytics - [Mixpanel sharedInstanceWithToken:@"0410357303b7b6b45b740e6f0e6d34be"]; - LKAnalytics.shared.trackImplementation = ^(NSString *event) { - NSDictionary *properties = @{ @"configuration" : LKBuildConfiguration.current }; - [Mixpanel.sharedInstance track:event properties:properties]; - }; #if DEBUG #else [FIRApp configure]; @@ -1261,7 +1254,6 @@ static NSTimeInterval launchStartedAt; performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { NSLog(@"[Loki] Performing background fetch."); - [LKAnalytics.shared track:@"Performed Background Fetch"]; [AppReadiness runNowOrWhenAppDidBecomeReady:^{ NSMutableArray *promises = [NSMutableArray new]; diff --git a/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m b/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m index dafdcceac..ccf65fe16 100644 --- a/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m +++ b/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m @@ -92,8 +92,6 @@ self.title = NSLocalizedString(@"SETTINGS_NAV_BAR_TITLE", @"Title for settings activity"); [self updateTableContents]; - - [LKAnalytics.shared track:@"Settings Opened"]; } - (void)viewWillAppear:(BOOL)animated @@ -536,7 +534,6 @@ } UIActivityViewController *shareVC = [[UIActivityViewController alloc] initWithActivityItems:@[ hexEncodedPublicKey ] applicationActivities:nil]; [self presentViewController:shareVC animated:YES completion:nil]; - [LKAnalytics.shared track:@"Public Key Shared"]; } - (void)showQRCode diff --git a/Signal/src/ViewControllers/AppSettings/PrivacySettingsTableViewController.m b/Signal/src/ViewControllers/AppSettings/PrivacySettingsTableViewController.m index f41e0f304..3a25a095b 100644 --- a/Signal/src/ViewControllers/AppSettings/PrivacySettingsTableViewController.m +++ b/Signal/src/ViewControllers/AppSettings/PrivacySettingsTableViewController.m @@ -462,7 +462,6 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s - (void)deleteThreadsAndMessages { - [LKAnalytics.shared track:@"Conversation History Cleared"]; [ThreadUtil deleteAllContent]; } @@ -470,11 +469,6 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s { BOOL enabled = sender.isOn; OWSLogInfo(@"toggled screen security: %@", enabled ? @"ON" : @"OFF"); - if (enabled) { - [LKAnalytics.shared track:@"Screen Security Enabled"]; - } else { - [LKAnalytics.shared track:@"Screen Security Disabled"]; - } [self.preferences setScreenSecurity:enabled]; } @@ -489,11 +483,6 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s { BOOL enabled = sender.isOn; OWSLogInfo(@"toggled areTypingIndicatorsEnabled: %@", enabled ? @"ON" : @"OFF"); - if (enabled) { - [LKAnalytics.shared track:@"Typing Indicators Enabled"]; - } else { - [LKAnalytics.shared track:@"Typing Indicators Disabled"]; - } [self.typingIndicators setTypingIndicatorsEnabledWithValue:enabled]; } @@ -549,11 +538,6 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s - (void)didToggleLinkPreviewsEnabled:(UISwitch *)sender { OWSLogInfo(@"toggled to: %@", (sender.isOn ? @"ON" : @"OFF")); - if (sender.isOn) { - [LKAnalytics.shared track:@"Link Previews Enabled"]; - } else { - [LKAnalytics.shared track:@"Link Previews Disabled"]; - } SSKPreferences.areLinkPreviewsEnabled = sender.isOn; } @@ -576,12 +560,6 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s } OWSLogInfo(@"trying to set is screen lock enabled: %@", @(shouldBeEnabled)); - - if (shouldBeEnabled) { - [LKAnalytics.shared track:@"Screen Lock Enabled"]; - } else { - [LKAnalytics.shared track:@"Screen Lock Disabled"]; - } [OWSScreenLock.sharedManager setIsScreenLockEnabled:shouldBeEnabled]; } diff --git a/Signal/src/ViewControllers/ProfileViewController.m b/Signal/src/ViewControllers/ProfileViewController.m index fc28590b4..7234eeea8 100644 --- a/Signal/src/ViewControllers/ProfileViewController.m +++ b/Signal/src/ViewControllers/ProfileViewController.m @@ -404,8 +404,6 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat if ([OWSProfileManager.sharedManager isProfileNameTooLong:normalizedProfileName]) { return [OWSAlerts showErrorAlertWithMessage:NSLocalizedString(@"Please pick a shorter display name", @"")]; } - - [LKAnalytics.shared track:@"Display Name Updated"]; // Show an activity indicator to block the UI during the profile upload. [ModalActivityIndicatorViewController diff --git a/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift b/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift index ec8d0c842..c05e37861 100644 --- a/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift +++ b/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift @@ -74,8 +74,6 @@ public class OnboardingSplashViewController: OnboardingBaseViewController { stackView.autoPin(toBottomLayoutGuideOf: self, withInset: 0) lokiLogoImageView.autoCenterInSuperview() - Analytics.shared.track("Landing Screen Viewed") - if UserDefaults.standard.bool(forKey: "wasUnlinked") { let alert = UIAlertController(title: NSLocalizedString("Device Unlinked", comment: ""), message: NSLocalizedString("Your device was unlinked successfully", comment: ""), preferredStyle: .alert) alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), accessibilityIdentifier: nil, style: .default, handler: nil)) diff --git a/SignalServiceKit/src/Loki/API/LokiAPI+SwarmAPI.swift b/SignalServiceKit/src/Loki/API/LokiAPI+SwarmAPI.swift index a423c356c..e4d8c6d48 100644 --- a/SignalServiceKit/src/Loki/API/LokiAPI+SwarmAPI.swift +++ b/SignalServiceKit/src/Loki/API/LokiAPI+SwarmAPI.swift @@ -78,7 +78,6 @@ public extension LokiAPI { return randomSnodePool.randomElement()! }.recover(on: DispatchQueue.global()) { error -> Promise in print("[Loki] Failed to contact seed node at: \(target).") - Analytics.shared.track("Seed Node Failed") throw error }.retryingIfNeeded(maxRetryCount: 16) // The seed nodes have historically been unreliable } else { diff --git a/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatAPI.swift b/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatAPI.swift index 5e99e451c..6245103f2 100644 --- a/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatAPI.swift +++ b/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatAPI.swift @@ -174,13 +174,7 @@ public final class LokiPublicChatAPI : LokiDotNetAPI { storage.dbReadWriteConnection.removeObject(forKey: server, inCollection: authTokenCollection) } throw error - }.retryingIfNeeded(maxRetryCount: maxRetryCount).map { message in - Analytics.shared.track("Group Message Sent") - return message - }.recover(on: DispatchQueue.global()) { error -> Promise in - Analytics.shared.track("Failed to Send Group Message") - throw error - } + }.retryingIfNeeded(maxRetryCount: maxRetryCount) } public static func getDeletedMessageServerIDs(for channel: UInt64, on server: String) -> Promise<[UInt64]> {