diff --git a/Podfile b/Podfile index 1a275b7f8..84f475372 100644 --- a/Podfile +++ b/Podfile @@ -62,7 +62,6 @@ def shared_pods pod 'PureLayout', :inhibit_warnings => true pod 'Reachability', :inhibit_warnings => true pod 'YYImage', :inhibit_warnings => true - pod 'IGIdenticon', :inhibit_warnings => true end target 'Signal' do diff --git a/Podfile.lock b/Podfile.lock index 9ef1e6e92..8074df569 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -56,7 +56,6 @@ PODS: - HKDFKit/Tests (0.0.4): - CocoaLumberjack - SignalCoreKit - - IGIdenticon (0.6) - libPhoneNumber-iOS (0.9.13) - Mantle (2.1.0): - Mantle/extobjc (= 2.1.0) @@ -220,7 +219,6 @@ DEPENDENCIES: - GRKOpenSSLFramework (from `https://github.com/signalapp/GRKOpenSSLFramework`) - HKDFKit (from `https://github.com/signalapp/HKDFKit.git`) - HKDFKit/Tests (from `https://github.com/signalapp/HKDFKit.git`) - - IGIdenticon - Mantle (from `https://github.com/signalapp/Mantle`, branch `signal-master`) - Mixpanel (~> 3.4) - NVActivityIndicatorView (~> 4.7) @@ -250,7 +248,6 @@ SPEC REPOS: - FirebaseCore - GCDWebServer - GoogleUtilities - - IGIdenticon - libPhoneNumber-iOS - Mixpanel - NVActivityIndicatorView @@ -332,7 +329,6 @@ SPEC CHECKSUMS: GoogleUtilities: 996e0db07153674fd1b54b220fda3a3dc3547cba GRKOpenSSLFramework: 8a3735ad41e7dc1daff460467bccd32ca5d6ae3e HKDFKit: 3b6dbbb9d59c221cc6c52c3aa915700cbf24e376 - IGIdenticon: 5790befde4fe56296927c72c0efed3d07b21de8e libPhoneNumber-iOS: e444379ac18bbfbdefad571da735b2cd7e096caa Mantle: 2fa750afa478cd625a94230fbf1c13462f29395b Mixpanel: 696e0a1c7f2685aa06bb23829b7a58ab7203d6c7 @@ -351,6 +347,6 @@ SPEC CHECKSUMS: YapDatabase: b418a4baa6906e8028748938f9159807fd039af4 YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54 -PODFILE CHECKSUM: ff66104e65cc960ed08a74b71c27f5caf59f4239 +PODFILE CHECKSUM: 156b349e2791f53224143291e318592b9c1f7ade COCOAPODS: 1.5.3 diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index c86a729c3..afdbb038c 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -3366,7 +3366,6 @@ "${PODS_ROOT}/GRKOpenSSLFramework/OpenSSL-iOS/bin/openssl.framework", "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", "${BUILT_PRODUCTS_DIR}/HKDFKit/HKDFKit.framework", - "${BUILT_PRODUCTS_DIR}/IGIdenticon/IGIdenticon.framework", "${BUILT_PRODUCTS_DIR}/Mantle/Mantle.framework", "${BUILT_PRODUCTS_DIR}/Mixpanel/Mixpanel.framework", "${BUILT_PRODUCTS_DIR}/NVActivityIndicatorView/NVActivityIndicatorView.framework", @@ -3397,7 +3396,6 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HKDFKit.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/IGIdenticon.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mantle.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mixpanel.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NVActivityIndicatorView.framework", @@ -3453,7 +3451,6 @@ "${BUILT_PRODUCTS_DIR}/Curve25519Kit/Curve25519Kit.framework", "${PODS_ROOT}/GRKOpenSSLFramework/OpenSSL-iOS/bin/openssl.framework", "${BUILT_PRODUCTS_DIR}/HKDFKit/HKDFKit.framework", - "${BUILT_PRODUCTS_DIR}/IGIdenticon/IGIdenticon.framework", "${BUILT_PRODUCTS_DIR}/Mantle/Mantle.framework", "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework", "${BUILT_PRODUCTS_DIR}/PureLayout/PureLayout.framework", @@ -3478,7 +3475,6 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Curve25519Kit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HKDFKit.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/IGIdenticon.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mantle.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PromiseKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PureLayout.framework", diff --git a/Signal/Images.xcassets/message_status_pow.imageset/Contents.json b/Signal/Images.xcassets/Loki/Cog.imageset/Contents.json similarity index 100% rename from Signal/Images.xcassets/message_status_pow.imageset/Contents.json rename to Signal/Images.xcassets/Loki/Cog.imageset/Contents.json diff --git a/Signal/Images.xcassets/message_status_pow.imageset/pow.png b/Signal/Images.xcassets/Loki/Cog.imageset/pow.png similarity index 100% rename from Signal/Images.xcassets/message_status_pow.imageset/pow.png rename to Signal/Images.xcassets/Loki/Cog.imageset/pow.png diff --git a/Signal/Images.xcassets/message_status_pow.imageset/pow@2x.png b/Signal/Images.xcassets/Loki/Cog.imageset/pow@2x.png similarity index 100% rename from Signal/Images.xcassets/message_status_pow.imageset/pow@2x.png rename to Signal/Images.xcassets/Loki/Cog.imageset/pow@2x.png diff --git a/Signal/Images.xcassets/message_status_pow.imageset/pow@3x.png b/Signal/Images.xcassets/Loki/Cog.imageset/pow@3x.png similarity index 100% rename from Signal/Images.xcassets/message_status_pow.imageset/pow@3x.png rename to Signal/Images.xcassets/Loki/Cog.imageset/pow@3x.png diff --git a/Signal/Images.xcassets/Loki/Contents.json b/Signal/Images.xcassets/Loki/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/Signal/Images.xcassets/Loki/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Signal/Images.xcassets/Crown.imageset/Contents.json b/Signal/Images.xcassets/Loki/Crown.imageset/Contents.json similarity index 100% rename from Signal/Images.xcassets/Crown.imageset/Contents.json rename to Signal/Images.xcassets/Loki/Crown.imageset/Contents.json diff --git a/Signal/Images.xcassets/Crown.imageset/crown.pdf b/Signal/Images.xcassets/Loki/Crown.imageset/crown.pdf similarity index 100% rename from Signal/Images.xcassets/Crown.imageset/crown.pdf rename to Signal/Images.xcassets/Loki/Crown.imageset/crown.pdf diff --git a/Signal/Images.xcassets/LokiLogo.imageset/Contents.json b/Signal/Images.xcassets/Loki/Loki.imageset/Contents.json similarity index 100% rename from Signal/Images.xcassets/LokiLogo.imageset/Contents.json rename to Signal/Images.xcassets/Loki/Loki.imageset/Contents.json diff --git a/Signal/Images.xcassets/LokiLogo.imageset/Loki_Logo_Icon_White.pdf b/Signal/Images.xcassets/Loki/Loki.imageset/Loki_Logo_Icon_White.pdf similarity index 100% rename from Signal/Images.xcassets/LokiLogo.imageset/Loki_Logo_Icon_White.pdf rename to Signal/Images.xcassets/Loki/Loki.imageset/Loki_Logo_Icon_White.pdf diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 89852e4a8..03d0f69d8 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -319,10 +319,10 @@ static NSTimeInterval launchStartedAt; name:NSNotificationName_2FAStateDidChange object:nil]; - // Loki - Observe messages received notifications + // Loki - Observe new messages received notifications [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNewMessagesReceived:) name:NSNotification.newMessagesReceived object:nil]; - // Loki - Observe thread deletion notifications + // Loki - Observe thread deleted notifications [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleThreadDeleted:) name:NSNotification.threadDeleted object:nil]; OWSLogInfo(@"application: didFinishLaunchingWithOptions completed."); @@ -744,7 +744,7 @@ static NSTimeInterval launchStartedAt; // and continue cleaning in the background. [self.disappearingMessagesJob startIfNecessary]; - // Start Loki friend request expire job + // Loki: Start friend request expiration job [self.lokiFriendRequestExpirationJob startIfNecessary]; [self enableBackgroundRefreshIfNecessary]; @@ -1206,6 +1206,7 @@ static NSTimeInterval launchStartedAt; performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { NSLog(@"[Loki] Performing background fetch."); + [LKAnalytics.shared track:@"Performed Background Fetch"]; [AppReadiness runNowOrWhenAppDidBecomeReady:^{ __block AnyPromise *job = [AppEnvironment.shared.messageFetcherJob run].then(^{ completionHandler(UIBackgroundFetchResultNewData); diff --git a/Signal/src/Jobs/SessionResetJob.swift b/Signal/src/Jobs/SessionResetJob.swift index a889d582a..0f27b3e11 100644 --- a/Signal/src/Jobs/SessionResetJob.swift +++ b/Signal/src/Jobs/SessionResetJob.swift @@ -109,7 +109,7 @@ public class SessionResetOperation: OWSOperation, DurableOperation { assert(self.durableOperationDelegate != nil) /* Loki: Original code - * We don't want to delete session. Ref: SignalServiceKit/Loki/Docs/SessionReset.md + * We don't want to delete the session. Ref: SignalServiceKit/Loki/Docs/SessionReset.md * ================ if firstAttempt { self.dbConnection.readWrite { transaction in diff --git a/Signal/src/Loki/LokiP2PServer.swift b/Signal/src/Loki/LokiP2PServer.swift index 06b07fa05..9aba9307f 100644 --- a/Signal/src/Loki/LokiP2PServer.swift +++ b/Signal/src/Loki/LokiP2PServer.swift @@ -1,5 +1,7 @@ import GCDWebServer +// TODO: Clean + private extension GCDWebServerResponse { convenience init(statusCode: E) where E.RawValue == Int { diff --git a/Signal/src/Loki/Onboarding/DisplayNameVC.swift b/Signal/src/Loki/Onboarding/DisplayNameVC.swift index 767b6b9a0..6efbf3721 100644 --- a/Signal/src/Loki/Onboarding/DisplayNameVC.swift +++ b/Signal/src/Loki/Onboarding/DisplayNameVC.swift @@ -50,6 +50,7 @@ final class DisplayNameVC : OnboardingBaseViewController { stackView.autoPin(toTopLayoutGuideOf: self, withInset: 0) autoPinView(toBottomOfViewControllerOrKeyboard: stackView, avoidNotch: true) topSpacer.autoMatch(.height, to: .height, of: bottomSpacer) + Analytics.shared.track("Display Name Screen Viewed") } override func viewDidAppear(_ animated: Bool) { diff --git a/Signal/src/Loki/Onboarding/SeedVC.swift b/Signal/src/Loki/Onboarding/SeedVC.swift index 29d8eb5a3..c518c2b1d 100644 --- a/Signal/src/Loki/Onboarding/SeedVC.swift +++ b/Signal/src/Loki/Onboarding/SeedVC.swift @@ -194,6 +194,7 @@ final class SeedVC : OnboardingBaseViewController, DeviceLinkingModalDelegate { setUpViewHierarchy() handleModeChanged() // Perform initial update updateSeed() + Analytics.shared.track("Seed Screen Viewed") } private func setUpViewHierarchy() { @@ -335,7 +336,7 @@ final class SeedVC : OnboardingBaseViewController, DeviceLinkingModalDelegate { switch mode { case .register: Analytics.shared.track("Seed Created") case .restore: Analytics.shared.track("Seed Restored") - case .link: Analytics.shared.track("Device Linked") + case .link: Analytics.shared.track("Device Linking Attempted") } if mode == .link { TSAccountManager.sharedInstance().didRegister() @@ -366,6 +367,7 @@ final class SeedVC : OnboardingBaseViewController, DeviceLinkingModalDelegate { linkingRequestMessageSendingTimer?.invalidate() UserDefaults.standard.set(true, forKey: "didUpdateForMainnet") onboardingController.verificationDidComplete(fromView: self) + Analytics.shared.track("Device Linked Successfully") } func handleDeviceLinkingModalDismissed() { diff --git a/Signal/src/Loki/Settings/NukeDataModal.swift b/Signal/src/Loki/Settings/NukeDataModal.swift index e23cb0ec2..936ddb59a 100644 --- a/Signal/src/Loki/Settings/NukeDataModal.swift +++ b/Signal/src/Loki/Settings/NukeDataModal.swift @@ -4,6 +4,11 @@ import NVActivityIndicatorView final class NukeDataModal : Modal { // MARK: Lifecycle + override func viewDidLoad() { + super.viewDidLoad() + Analytics.shared.track("Nuke Data Modal Shown") + } + override func populateContentView() { // Label let titleLabel = UILabel() @@ -43,6 +48,7 @@ final class NukeDataModal : Modal { // MARK: Interaction @objc private func nuke() { + Analytics.shared.track("Data Nuked") ThreadUtil.deleteAllContent() SSKEnvironment.shared.identityManager.clearIdentityKey() LokiAPI.clearRandomSnodePool() diff --git a/Signal/src/Loki/Settings/SeedModal.swift b/Signal/src/Loki/Settings/SeedModal.swift index 84cf3802c..5d9cf30c1 100644 --- a/Signal/src/Loki/Settings/SeedModal.swift +++ b/Signal/src/Loki/Settings/SeedModal.swift @@ -14,6 +14,11 @@ final class SeedModal : Modal { }() // MARK: Lifecycle + override func viewDidLoad() { + super.viewDidLoad() + Analytics.shared.track("Seed Modal Shown") + } + override func populateContentView() { // Label let titleLabel = UILabel() diff --git a/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m b/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m index 5ba9a9101..d1c515728 100644 --- a/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m +++ b/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.m @@ -21,6 +21,7 @@ #import #import #import +#import "Session-Swift.h" @interface AppSettingsViewController () @@ -91,6 +92,8 @@ self.title = NSLocalizedString(@"SETTINGS_NAV_BAR_TITLE", @"Title for settings activity"); [self updateTableContents]; + + [LKAnalytics.shared track:@"Settings Opened"]; } - (void)viewWillAppear:(BOOL)animated @@ -501,9 +504,10 @@ - (void)sharePublicKey { - NSString *publicKey = OWSIdentityManager.sharedManager.identityKeyPair.hexEncodedPublicKey; - UIActivityViewController *shareVC = [[UIActivityViewController alloc] initWithActivityItems:@[ publicKey ] applicationActivities:nil]; + NSString *hexEncodedPublicKey = OWSIdentityManager.sharedManager.identityKeyPair.hexEncodedPublicKey; + 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/NotificationSettingsViewController.m b/Signal/src/ViewControllers/AppSettings/NotificationSettingsViewController.m index 42c6dc393..84ec3346c 100644 --- a/Signal/src/ViewControllers/AppSettings/NotificationSettingsViewController.m +++ b/Signal/src/ViewControllers/AppSettings/NotificationSettingsViewController.m @@ -9,6 +9,7 @@ #import #import #import +#import "Session-Swift.h" @implementation NotificationSettingsViewController @@ -19,6 +20,8 @@ [self setTitle:NSLocalizedString(@"SETTINGS_NOTIFICATIONS", nil)]; [self updateTableContents]; + + [LKAnalytics.shared track:@"Notification Settings Opened"]; } - (void)viewDidAppear:(BOOL)animated diff --git a/Signal/src/ViewControllers/AppSettings/PrivacySettingsTableViewController.m b/Signal/src/ViewControllers/AppSettings/PrivacySettingsTableViewController.m index 793970be5..d37dde600 100644 --- a/Signal/src/ViewControllers/AppSettings/PrivacySettingsTableViewController.m +++ b/Signal/src/ViewControllers/AppSettings/PrivacySettingsTableViewController.m @@ -30,6 +30,8 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s [self observeNotifications]; [self updateTableContents]; + + [LKAnalytics.shared track:@"Privacy Settings Opened"]; } - (void)viewDidAppear:(BOOL)animated @@ -445,6 +447,7 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s - (void)deleteThreadsAndMessages { + [LKAnalytics.shared track:@"Conversation History Cleared"]; [ThreadUtil deleteAllContent]; } @@ -452,6 +455,11 @@ 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]; } @@ -466,6 +474,11 @@ 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]; } @@ -521,6 +534,11 @@ 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; } @@ -544,6 +562,12 @@ 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/ConversationView/Cells/OWSMessageCell.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m index 1203f9216..6bfac127f 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m @@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic) OWSMessageBubbleView *messageBubbleView; @property (nonatomic) NSLayoutConstraint *messageBubbleViewBottomConstraint; @property (nonatomic) AvatarImageView *avatarView; -@property (nonatomic) UIImageView *moderatorIconView; +@property (nonatomic) UIImageView *moderatorIconImageView; @property (nonatomic, nullable) LKFriendRequestView *friendRequestView; @property (nonatomic, nullable) UIImageView *sendFailureBadgeView; @@ -62,10 +62,10 @@ NS_ASSUME_NONNULL_BEGIN [self.avatarView autoSetDimension:ALDimensionWidth toSize:self.avatarSize]; [self.avatarView autoSetDimension:ALDimensionHeight toSize:self.avatarSize]; - self.moderatorIconView = [[UIImageView alloc] init]; - [self.moderatorIconView autoSetDimension:ALDimensionWidth toSize:20.f]; - [self.moderatorIconView autoSetDimension:ALDimensionHeight toSize:20.f]; - self.moderatorIconView.hidden = YES; + self.moderatorIconImageView = [[UIImageView alloc] init]; + [self.moderatorIconImageView autoSetDimension:ALDimensionWidth toSize:20.f]; + [self.moderatorIconImageView autoSetDimension:ALDimensionHeight toSize:20.f]; + self.moderatorIconImageView.hidden = YES; self.messageBubbleViewBottomConstraint = [self.messageBubbleView autoPinBottomToSuperviewMarginWithInset:0]; @@ -235,8 +235,8 @@ NS_ASSUME_NONNULL_BEGIN ]]; [self.viewConstraints addObjectsFromArray:@[ - [self.moderatorIconView autoPinEdge:ALEdgeTrailing toEdge:ALEdgeTrailing ofView:self.avatarView], - [self.moderatorIconView autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.avatarView withOffset:3.5] + [self.moderatorIconImageView autoPinEdge:ALEdgeTrailing toEdge:ALEdgeTrailing ofView:self.avatarView], + [self.moderatorIconImageView autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.avatarView withOffset:3.5] ]]; } } @@ -300,11 +300,11 @@ NS_ASSUME_NONNULL_BEGIN if (self.viewItem.isGroupThread && !self.viewItem.isRSSFeed) { BOOL isModerator = [LKGroupChatAPI isUserModerator:incomingMessage.authorId forGroup:LKGroupChatAPI.publicChatServerID onServer:LKGroupChatAPI.publicChatServer]; UIImage *moderatorIcon = [UIImage imageNamed:@"Crown"]; - self.moderatorIconView.image = moderatorIcon; - self.moderatorIconView.hidden = !isModerator; + self.moderatorIconImageView.image = moderatorIcon; + self.moderatorIconImageView.hidden = !isModerator; } - [self.contentView addSubview:self.moderatorIconView]; + [self.contentView addSubview:self.moderatorIconImageView]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(otherUsersProfileDidChange:) @@ -405,8 +405,8 @@ NS_ASSUME_NONNULL_BEGIN self.avatarView.image = nil; [self.avatarView removeFromSuperview]; - self.moderatorIconView.image = nil; - [self.moderatorIconView removeFromSuperview]; + self.moderatorIconImageView.image = nil; + [self.moderatorIconImageView removeFromSuperview]; [self.sendFailureBadgeView removeFromSuperview]; self.sendFailureBadgeView = nil; diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m index 38e9c2e53..e32b3cc55 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m @@ -123,7 +123,7 @@ NS_ASSUME_NONNULL_BEGIN [MessageRecipientStatusUtils recipientStatusWithOutgoingMessage:outgoingMessage]; switch (messageStatus) { case MessageReceiptStatusCalculatingPoW: - statusIndicatorImage = [UIImage imageNamed:@"message_status_pow"]; + statusIndicatorImage = [UIImage imageNamed:@"Cog"]; [self animateSpinningIcon]; break; case MessageReceiptStatusUploading: diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 6814e7bae..22de2a08d 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -616,6 +616,7 @@ typedef enum : NSUInteger { [self applyTheme]; [self.conversationViewModel viewDidLoad]; + // Loki: Track events if (self.thread.isGroupThread) { if (self.isRSSFeed) { [LKAnalytics.shared track:@"RSS Feed Opened"]; diff --git a/Signal/src/ViewControllers/HomeView/HomeViewCell.m b/Signal/src/ViewControllers/HomeView/HomeViewCell.m index 543f0bf29..0c558dd73 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewCell.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewCell.m @@ -309,7 +309,7 @@ NS_ASSUME_NONNULL_BEGIN [MessageRecipientStatusUtils recipientStatusWithOutgoingMessage:outgoingMessage]; switch (messageStatus) { case MessageReceiptStatusCalculatingPoW: - statusIndicatorImage = [UIImage imageNamed:@"message_status_pow"]; + statusIndicatorImage = [UIImage imageNamed:@"Cog"]; shouldAnimateStatusIcon = YES; break; case MessageReceiptStatusUploading: diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index ca513eda8..1b20159b6 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -1428,7 +1428,7 @@ typedef NS_ENUM(NSInteger, HomeViewControllerSection) { [thread removeWithTransaction:transaction]; }]; - // Loki - Post notification + // Loki: Post notification [[NSNotificationCenter defaultCenter] postNotificationName:NSNotification.threadDeleted object:nil userInfo:@{ @"threadId": thread.uniqueId }]; [self updateViewState]; diff --git a/Signal/src/ViewControllers/LoadingViewController.swift b/Signal/src/ViewControllers/LoadingViewController.swift index 469063266..1533f9375 100644 --- a/Signal/src/ViewControllers/LoadingViewController.swift +++ b/Signal/src/ViewControllers/LoadingViewController.swift @@ -18,7 +18,7 @@ public class LoadingViewController: UIViewController { self.view = UIView() view.backgroundColor = UIColor.lokiDarkestGray() - self.logoView = UIImageView(image: #imageLiteral(resourceName: "LokiLogo")) + self.logoView = UIImageView(image: #imageLiteral(resourceName: "Loki")) view.addSubview(logoView) logoView.autoCenterInSuperview() diff --git a/Signal/src/ViewControllers/ProfileViewController.m b/Signal/src/ViewControllers/ProfileViewController.m index 1fdd2cfc5..5284b96f6 100644 --- a/Signal/src/ViewControllers/ProfileViewController.m +++ b/Signal/src/ViewControllers/ProfileViewController.m @@ -401,6 +401,8 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat return; } + [LKAnalytics.shared track:@"Display Name Updated"]; + // Show an activity indicator to block the UI during the profile upload. [ModalActivityIndicatorViewController presentFromViewController:self diff --git a/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift b/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift index 6b8e9cd36..0dc05bae6 100644 --- a/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift +++ b/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift @@ -19,7 +19,7 @@ public class OnboardingSplashViewController: OnboardingBaseViewController { titleLabel.autoPinEdges(toSuperviewMarginsExcludingEdge: .bottom) titleLabel.accessibilityIdentifier = "onboarding.splash." + "titleLabel" - let lokiLogo = UIImage(named: "LokiLogo") + let lokiLogo = UIImage(named: "Loki") let lokiLogoImageView = UIImageView(image: lokiLogo) lokiLogoImageView.accessibilityIdentifier = "onboarding.splash." + "lokiLogoImageView" lokiLogoImageView.autoSetDimension(.height, toSize: 71) @@ -72,6 +72,8 @@ public class OnboardingSplashViewController: OnboardingBaseViewController { stackView.autoPin(toTopLayoutGuideOf: self, withInset: 0) stackView.autoPin(toBottomLayoutGuideOf: self, withInset: 0) lokiLogoImageView.autoCenterInSuperview() + + Analytics.shared.track("Landing Screen Viewed") } // MARK: - Events diff --git a/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m b/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m index a7170caff..00a090e40 100644 --- a/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m +++ b/Signal/src/ViewControllers/ThreadSettings/OWSConversationSettingsViewController.m @@ -292,6 +292,8 @@ const CGFloat kIconViewLength = 24; #endif [self updateTableContents]; + + [LKAnalytics.shared track:@"Conversation Settings Opened"]; } - (void)viewDidAppear:(BOOL)animated diff --git a/Signal/src/util/Launch Screen.storyboard b/Signal/src/util/Launch Screen.storyboard index 87f013517..a24e8c85a 100644 --- a/Signal/src/util/Launch Screen.storyboard +++ b/Signal/src/util/Launch Screen.storyboard @@ -1,11 +1,7 @@ - - - - + - - + @@ -18,11 +14,11 @@ - + - - + + @@ -42,6 +38,6 @@ - + diff --git a/SignalMessaging/Loki/JazzIcon.swift b/SignalMessaging/Loki/JazzIcon.swift index c1c5adfd5..77dac8d1a 100644 --- a/SignalMessaging/Loki/JazzIcon.swift +++ b/SignalMessaging/Loki/JazzIcon.swift @@ -145,6 +145,6 @@ public class JazzIcon { private func hueShift(colours: [UIColor]) -> [UIColor] { let amount = generator.nextCGFloat() * 30 - CGFloat(wobble / 2); - return colours.map { $0.adjust(hueBy: amount) } + return colours.map { $0.adjustHue(by: amount) } } } diff --git a/SignalMessaging/Loki/UIColor+Helper.swift b/SignalMessaging/Loki/UIColor+Helper.swift index 47cec7330..48ee0926d 100644 --- a/SignalMessaging/Loki/UIColor+Helper.swift +++ b/SignalMessaging/Loki/UIColor+Helper.swift @@ -1,7 +1,7 @@ extension UIColor { - public func adjust(hueBy degrees: CGFloat) -> UIColor { + public func adjustHue(by degrees: CGFloat) -> UIColor { var currentHue: CGFloat = 0.0 var currentSaturation: CGFloat = 0.0 diff --git a/SignalMessaging/ViewControllers/ScreenLockViewController.m b/SignalMessaging/ViewControllers/ScreenLockViewController.m index 6c2733250..7150589b7 100644 --- a/SignalMessaging/ViewControllers/ScreenLockViewController.m +++ b/SignalMessaging/ViewControllers/ScreenLockViewController.m @@ -45,7 +45,7 @@ NSString *NSStringForScreenLockUIState(ScreenLockUIState value) [edgesView autoPinEdgeToSuperviewEdge:ALEdgeBottom]; [edgesView autoPinWidthToSuperview]; - UIImage *image = [UIImage imageNamed:@"LokiLogo"]; + UIImage *image = [UIImage imageNamed:@"Loki"]; UIImageView *imageView = [UIImageView new]; imageView.image = image; [edgesView addSubview:imageView]; diff --git a/SignalServiceKit/src/Account/CreatePreKeysOperation.swift b/SignalServiceKit/src/Account/CreatePreKeysOperation.swift index b04e86f07..2a14afc7a 100644 --- a/SignalServiceKit/src/Account/CreatePreKeysOperation.swift +++ b/SignalServiceKit/src/Account/CreatePreKeysOperation.swift @@ -29,7 +29,7 @@ public class CreatePreKeysOperation: OWSOperation { // Loki: We don't generate PreKeyRecords here. // This is because we need the records to be linked to a contact since we don't have a central server. - // It is done automatically when we generate a PreKeyBundle to send to a contact (`generatePreKeyBundleForContact:`). + // It's done automatically when we generate a pre key bundle to send to a contact (`generatePreKeyBundleForContact:`). // You can use `getOrCreatePreKeyForContact:` to generate one if needed. let signedPreKeyRecord = primaryStorage.generateRandomSignedRecord() signedPreKeyRecord.markAsAcceptedByService() diff --git a/SignalServiceKit/src/Loki/Messaging/LKDeviceLinkMessage.m b/SignalServiceKit/src/Loki/Messaging/LKDeviceLinkMessage.m index 285ac3f48..0ce253593 100644 --- a/SignalServiceKit/src/Loki/Messaging/LKDeviceLinkMessage.m +++ b/SignalServiceKit/src/Loki/Messaging/LKDeviceLinkMessage.m @@ -65,6 +65,7 @@ } #pragma mark Settings +- (uint)ttl { 8 * kMinuteInMs; } - (BOOL)shouldSyncTranscript { return NO; } - (BOOL)shouldBeSaved { return NO; } diff --git a/SignalServiceKit/src/Messages/OWSMessageManager.m b/SignalServiceKit/src/Messages/OWSMessageManager.m index 42e5a5a7a..72d60115a 100644 --- a/SignalServiceKit/src/Messages/OWSMessageManager.m +++ b/SignalServiceKit/src/Messages/OWSMessageManager.m @@ -1404,7 +1404,6 @@ NS_ASSUME_NONNULL_BEGIN } // Loki: Don't process friend requests in group chats - if (body.length == 0 && attachmentPointers.count < 1 && !contact) { OWSLogWarn(@"ignoring empty incoming message from: %@ for group: %@ with timestamp: %lu", envelopeAddress(envelope),