Set device link message TTL, clean & add more analytics

pull/56/head
Niels Andriesse 6 years ago
parent 9fcb0f610f
commit 40bb4ba1a4

@ -62,7 +62,6 @@ def shared_pods
pod 'PureLayout', :inhibit_warnings => true pod 'PureLayout', :inhibit_warnings => true
pod 'Reachability', :inhibit_warnings => true pod 'Reachability', :inhibit_warnings => true
pod 'YYImage', :inhibit_warnings => true pod 'YYImage', :inhibit_warnings => true
pod 'IGIdenticon', :inhibit_warnings => true
end end
target 'Signal' do target 'Signal' do

@ -56,7 +56,6 @@ PODS:
- HKDFKit/Tests (0.0.4): - HKDFKit/Tests (0.0.4):
- CocoaLumberjack - CocoaLumberjack
- SignalCoreKit - SignalCoreKit
- IGIdenticon (0.6)
- libPhoneNumber-iOS (0.9.13) - libPhoneNumber-iOS (0.9.13)
- Mantle (2.1.0): - Mantle (2.1.0):
- Mantle/extobjc (= 2.1.0) - Mantle/extobjc (= 2.1.0)
@ -220,7 +219,6 @@ DEPENDENCIES:
- GRKOpenSSLFramework (from `https://github.com/signalapp/GRKOpenSSLFramework`) - GRKOpenSSLFramework (from `https://github.com/signalapp/GRKOpenSSLFramework`)
- HKDFKit (from `https://github.com/signalapp/HKDFKit.git`) - HKDFKit (from `https://github.com/signalapp/HKDFKit.git`)
- HKDFKit/Tests (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`) - Mantle (from `https://github.com/signalapp/Mantle`, branch `signal-master`)
- Mixpanel (~> 3.4) - Mixpanel (~> 3.4)
- NVActivityIndicatorView (~> 4.7) - NVActivityIndicatorView (~> 4.7)
@ -250,7 +248,6 @@ SPEC REPOS:
- FirebaseCore - FirebaseCore
- GCDWebServer - GCDWebServer
- GoogleUtilities - GoogleUtilities
- IGIdenticon
- libPhoneNumber-iOS - libPhoneNumber-iOS
- Mixpanel - Mixpanel
- NVActivityIndicatorView - NVActivityIndicatorView
@ -332,7 +329,6 @@ SPEC CHECKSUMS:
GoogleUtilities: 996e0db07153674fd1b54b220fda3a3dc3547cba GoogleUtilities: 996e0db07153674fd1b54b220fda3a3dc3547cba
GRKOpenSSLFramework: 8a3735ad41e7dc1daff460467bccd32ca5d6ae3e GRKOpenSSLFramework: 8a3735ad41e7dc1daff460467bccd32ca5d6ae3e
HKDFKit: 3b6dbbb9d59c221cc6c52c3aa915700cbf24e376 HKDFKit: 3b6dbbb9d59c221cc6c52c3aa915700cbf24e376
IGIdenticon: 5790befde4fe56296927c72c0efed3d07b21de8e
libPhoneNumber-iOS: e444379ac18bbfbdefad571da735b2cd7e096caa libPhoneNumber-iOS: e444379ac18bbfbdefad571da735b2cd7e096caa
Mantle: 2fa750afa478cd625a94230fbf1c13462f29395b Mantle: 2fa750afa478cd625a94230fbf1c13462f29395b
Mixpanel: 696e0a1c7f2685aa06bb23829b7a58ab7203d6c7 Mixpanel: 696e0a1c7f2685aa06bb23829b7a58ab7203d6c7
@ -351,6 +347,6 @@ SPEC CHECKSUMS:
YapDatabase: b418a4baa6906e8028748938f9159807fd039af4 YapDatabase: b418a4baa6906e8028748938f9159807fd039af4
YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54 YYImage: 1e1b62a9997399593e4b9c4ecfbbabbf1d3f3b54
PODFILE CHECKSUM: ff66104e65cc960ed08a74b71c27f5caf59f4239 PODFILE CHECKSUM: 156b349e2791f53224143291e318592b9c1f7ade
COCOAPODS: 1.5.3 COCOAPODS: 1.5.3

@ -3366,7 +3366,6 @@
"${PODS_ROOT}/GRKOpenSSLFramework/OpenSSL-iOS/bin/openssl.framework", "${PODS_ROOT}/GRKOpenSSLFramework/OpenSSL-iOS/bin/openssl.framework",
"${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
"${BUILT_PRODUCTS_DIR}/HKDFKit/HKDFKit.framework", "${BUILT_PRODUCTS_DIR}/HKDFKit/HKDFKit.framework",
"${BUILT_PRODUCTS_DIR}/IGIdenticon/IGIdenticon.framework",
"${BUILT_PRODUCTS_DIR}/Mantle/Mantle.framework", "${BUILT_PRODUCTS_DIR}/Mantle/Mantle.framework",
"${BUILT_PRODUCTS_DIR}/Mixpanel/Mixpanel.framework", "${BUILT_PRODUCTS_DIR}/Mixpanel/Mixpanel.framework",
"${BUILT_PRODUCTS_DIR}/NVActivityIndicatorView/NVActivityIndicatorView.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}/openssl.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HKDFKit.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}/Mantle.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mixpanel.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mixpanel.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NVActivityIndicatorView.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NVActivityIndicatorView.framework",
@ -3453,7 +3451,6 @@
"${BUILT_PRODUCTS_DIR}/Curve25519Kit/Curve25519Kit.framework", "${BUILT_PRODUCTS_DIR}/Curve25519Kit/Curve25519Kit.framework",
"${PODS_ROOT}/GRKOpenSSLFramework/OpenSSL-iOS/bin/openssl.framework", "${PODS_ROOT}/GRKOpenSSLFramework/OpenSSL-iOS/bin/openssl.framework",
"${BUILT_PRODUCTS_DIR}/HKDFKit/HKDFKit.framework", "${BUILT_PRODUCTS_DIR}/HKDFKit/HKDFKit.framework",
"${BUILT_PRODUCTS_DIR}/IGIdenticon/IGIdenticon.framework",
"${BUILT_PRODUCTS_DIR}/Mantle/Mantle.framework", "${BUILT_PRODUCTS_DIR}/Mantle/Mantle.framework",
"${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework", "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework",
"${BUILT_PRODUCTS_DIR}/PureLayout/PureLayout.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}/Curve25519Kit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HKDFKit.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}/Mantle.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PromiseKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PromiseKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PureLayout.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PureLayout.framework",

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 277 B

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

@ -319,10 +319,10 @@ static NSTimeInterval launchStartedAt;
name:NSNotificationName_2FAStateDidChange name:NSNotificationName_2FAStateDidChange
object:nil]; 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]; [[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]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleThreadDeleted:) name:NSNotification.threadDeleted object:nil];
OWSLogInfo(@"application: didFinishLaunchingWithOptions completed."); OWSLogInfo(@"application: didFinishLaunchingWithOptions completed.");
@ -744,7 +744,7 @@ static NSTimeInterval launchStartedAt;
// and continue cleaning in the background. // and continue cleaning in the background.
[self.disappearingMessagesJob startIfNecessary]; [self.disappearingMessagesJob startIfNecessary];
// Start Loki friend request expire job // Loki: Start friend request expiration job
[self.lokiFriendRequestExpirationJob startIfNecessary]; [self.lokiFriendRequestExpirationJob startIfNecessary];
[self enableBackgroundRefreshIfNecessary]; [self enableBackgroundRefreshIfNecessary];
@ -1206,6 +1206,7 @@ static NSTimeInterval launchStartedAt;
performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler
{ {
NSLog(@"[Loki] Performing background fetch."); NSLog(@"[Loki] Performing background fetch.");
[LKAnalytics.shared track:@"Performed Background Fetch"];
[AppReadiness runNowOrWhenAppDidBecomeReady:^{ [AppReadiness runNowOrWhenAppDidBecomeReady:^{
__block AnyPromise *job = [AppEnvironment.shared.messageFetcherJob run].then(^{ __block AnyPromise *job = [AppEnvironment.shared.messageFetcherJob run].then(^{
completionHandler(UIBackgroundFetchResultNewData); completionHandler(UIBackgroundFetchResultNewData);

@ -109,7 +109,7 @@ public class SessionResetOperation: OWSOperation, DurableOperation {
assert(self.durableOperationDelegate != nil) assert(self.durableOperationDelegate != nil)
/* Loki: Original code /* 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 { if firstAttempt {
self.dbConnection.readWrite { transaction in self.dbConnection.readWrite { transaction in

@ -1,5 +1,7 @@
import GCDWebServer import GCDWebServer
// TODO: Clean
private extension GCDWebServerResponse { private extension GCDWebServerResponse {
convenience init<E: RawRepresentable>(statusCode: E) where E.RawValue == Int { convenience init<E: RawRepresentable>(statusCode: E) where E.RawValue == Int {

@ -50,6 +50,7 @@ final class DisplayNameVC : OnboardingBaseViewController {
stackView.autoPin(toTopLayoutGuideOf: self, withInset: 0) stackView.autoPin(toTopLayoutGuideOf: self, withInset: 0)
autoPinView(toBottomOfViewControllerOrKeyboard: stackView, avoidNotch: true) autoPinView(toBottomOfViewControllerOrKeyboard: stackView, avoidNotch: true)
topSpacer.autoMatch(.height, to: .height, of: bottomSpacer) topSpacer.autoMatch(.height, to: .height, of: bottomSpacer)
Analytics.shared.track("Display Name Screen Viewed")
} }
override func viewDidAppear(_ animated: Bool) { override func viewDidAppear(_ animated: Bool) {

@ -194,6 +194,7 @@ final class SeedVC : OnboardingBaseViewController, DeviceLinkingModalDelegate {
setUpViewHierarchy() setUpViewHierarchy()
handleModeChanged() // Perform initial update handleModeChanged() // Perform initial update
updateSeed() updateSeed()
Analytics.shared.track("Seed Screen Viewed")
} }
private func setUpViewHierarchy() { private func setUpViewHierarchy() {
@ -335,7 +336,7 @@ final class SeedVC : OnboardingBaseViewController, DeviceLinkingModalDelegate {
switch mode { switch mode {
case .register: Analytics.shared.track("Seed Created") case .register: Analytics.shared.track("Seed Created")
case .restore: Analytics.shared.track("Seed Restored") 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 { if mode == .link {
TSAccountManager.sharedInstance().didRegister() TSAccountManager.sharedInstance().didRegister()
@ -366,6 +367,7 @@ final class SeedVC : OnboardingBaseViewController, DeviceLinkingModalDelegate {
linkingRequestMessageSendingTimer?.invalidate() linkingRequestMessageSendingTimer?.invalidate()
UserDefaults.standard.set(true, forKey: "didUpdateForMainnet") UserDefaults.standard.set(true, forKey: "didUpdateForMainnet")
onboardingController.verificationDidComplete(fromView: self) onboardingController.verificationDidComplete(fromView: self)
Analytics.shared.track("Device Linked Successfully")
} }
func handleDeviceLinkingModalDismissed() { func handleDeviceLinkingModalDismissed() {

@ -4,6 +4,11 @@ import NVActivityIndicatorView
final class NukeDataModal : Modal { final class NukeDataModal : Modal {
// MARK: Lifecycle // MARK: Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
Analytics.shared.track("Nuke Data Modal Shown")
}
override func populateContentView() { override func populateContentView() {
// Label // Label
let titleLabel = UILabel() let titleLabel = UILabel()
@ -43,6 +48,7 @@ final class NukeDataModal : Modal {
// MARK: Interaction // MARK: Interaction
@objc private func nuke() { @objc private func nuke() {
Analytics.shared.track("Data Nuked")
ThreadUtil.deleteAllContent() ThreadUtil.deleteAllContent()
SSKEnvironment.shared.identityManager.clearIdentityKey() SSKEnvironment.shared.identityManager.clearIdentityKey()
LokiAPI.clearRandomSnodePool() LokiAPI.clearRandomSnodePool()

@ -14,6 +14,11 @@ final class SeedModal : Modal {
}() }()
// MARK: Lifecycle // MARK: Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
Analytics.shared.track("Seed Modal Shown")
}
override func populateContentView() { override func populateContentView() {
// Label // Label
let titleLabel = UILabel() let titleLabel = UILabel()

@ -21,6 +21,7 @@
#import <SignalMessaging/UIUtil.h> #import <SignalMessaging/UIUtil.h>
#import <SignalServiceKit/TSAccountManager.h> #import <SignalServiceKit/TSAccountManager.h>
#import <SignalServiceKit/TSSocketManager.h> #import <SignalServiceKit/TSSocketManager.h>
#import "Session-Swift.h"
@interface AppSettingsViewController () @interface AppSettingsViewController ()
@ -91,6 +92,8 @@
self.title = NSLocalizedString(@"SETTINGS_NAV_BAR_TITLE", @"Title for settings activity"); self.title = NSLocalizedString(@"SETTINGS_NAV_BAR_TITLE", @"Title for settings activity");
[self updateTableContents]; [self updateTableContents];
[LKAnalytics.shared track:@"Settings Opened"];
} }
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated
@ -501,9 +504,10 @@
- (void)sharePublicKey - (void)sharePublicKey
{ {
NSString *publicKey = OWSIdentityManager.sharedManager.identityKeyPair.hexEncodedPublicKey; NSString *hexEncodedPublicKey = OWSIdentityManager.sharedManager.identityKeyPair.hexEncodedPublicKey;
UIActivityViewController *shareVC = [[UIActivityViewController alloc] initWithActivityItems:@[ publicKey ] applicationActivities:nil]; UIActivityViewController *shareVC = [[UIActivityViewController alloc] initWithActivityItems:@[ hexEncodedPublicKey ] applicationActivities:nil];
[self presentViewController:shareVC animated:YES completion:nil]; [self presentViewController:shareVC animated:YES completion:nil];
[LKAnalytics.shared track:@"Public Key Shared"];
} }
- (void)showQRCode - (void)showQRCode

@ -9,6 +9,7 @@
#import <SignalMessaging/OWSPreferences.h> #import <SignalMessaging/OWSPreferences.h>
#import <SignalMessaging/OWSSounds.h> #import <SignalMessaging/OWSSounds.h>
#import <SignalMessaging/UIUtil.h> #import <SignalMessaging/UIUtil.h>
#import "Session-Swift.h"
@implementation NotificationSettingsViewController @implementation NotificationSettingsViewController
@ -19,6 +20,8 @@
[self setTitle:NSLocalizedString(@"SETTINGS_NOTIFICATIONS", nil)]; [self setTitle:NSLocalizedString(@"SETTINGS_NOTIFICATIONS", nil)];
[self updateTableContents]; [self updateTableContents];
[LKAnalytics.shared track:@"Notification Settings Opened"];
} }
- (void)viewDidAppear:(BOOL)animated - (void)viewDidAppear:(BOOL)animated

@ -30,6 +30,8 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
[self observeNotifications]; [self observeNotifications];
[self updateTableContents]; [self updateTableContents];
[LKAnalytics.shared track:@"Privacy Settings Opened"];
} }
- (void)viewDidAppear:(BOOL)animated - (void)viewDidAppear:(BOOL)animated
@ -445,6 +447,7 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
- (void)deleteThreadsAndMessages - (void)deleteThreadsAndMessages
{ {
[LKAnalytics.shared track:@"Conversation History Cleared"];
[ThreadUtil deleteAllContent]; [ThreadUtil deleteAllContent];
} }
@ -452,6 +455,11 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
{ {
BOOL enabled = sender.isOn; BOOL enabled = sender.isOn;
OWSLogInfo(@"toggled screen security: %@", enabled ? @"ON" : @"OFF"); 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]; [self.preferences setScreenSecurity:enabled];
} }
@ -466,6 +474,11 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
{ {
BOOL enabled = sender.isOn; BOOL enabled = sender.isOn;
OWSLogInfo(@"toggled areTypingIndicatorsEnabled: %@", enabled ? @"ON" : @"OFF"); 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]; [self.typingIndicators setTypingIndicatorsEnabledWithValue:enabled];
} }
@ -521,6 +534,11 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
- (void)didToggleLinkPreviewsEnabled:(UISwitch *)sender - (void)didToggleLinkPreviewsEnabled:(UISwitch *)sender
{ {
OWSLogInfo(@"toggled to: %@", (sender.isOn ? @"ON" : @"OFF")); 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; 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)); 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]; [OWSScreenLock.sharedManager setIsScreenLockEnabled:shouldBeEnabled];
} }

@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic) OWSMessageBubbleView *messageBubbleView; @property (nonatomic) OWSMessageBubbleView *messageBubbleView;
@property (nonatomic) NSLayoutConstraint *messageBubbleViewBottomConstraint; @property (nonatomic) NSLayoutConstraint *messageBubbleViewBottomConstraint;
@property (nonatomic) AvatarImageView *avatarView; @property (nonatomic) AvatarImageView *avatarView;
@property (nonatomic) UIImageView *moderatorIconView; @property (nonatomic) UIImageView *moderatorIconImageView;
@property (nonatomic, nullable) LKFriendRequestView *friendRequestView; @property (nonatomic, nullable) LKFriendRequestView *friendRequestView;
@property (nonatomic, nullable) UIImageView *sendFailureBadgeView; @property (nonatomic, nullable) UIImageView *sendFailureBadgeView;
@ -62,10 +62,10 @@ NS_ASSUME_NONNULL_BEGIN
[self.avatarView autoSetDimension:ALDimensionWidth toSize:self.avatarSize]; [self.avatarView autoSetDimension:ALDimensionWidth toSize:self.avatarSize];
[self.avatarView autoSetDimension:ALDimensionHeight toSize:self.avatarSize]; [self.avatarView autoSetDimension:ALDimensionHeight toSize:self.avatarSize];
self.moderatorIconView = [[UIImageView alloc] init]; self.moderatorIconImageView = [[UIImageView alloc] init];
[self.moderatorIconView autoSetDimension:ALDimensionWidth toSize:20.f]; [self.moderatorIconImageView autoSetDimension:ALDimensionWidth toSize:20.f];
[self.moderatorIconView autoSetDimension:ALDimensionHeight toSize:20.f]; [self.moderatorIconImageView autoSetDimension:ALDimensionHeight toSize:20.f];
self.moderatorIconView.hidden = YES; self.moderatorIconImageView.hidden = YES;
self.messageBubbleViewBottomConstraint = [self.messageBubbleView autoPinBottomToSuperviewMarginWithInset:0]; self.messageBubbleViewBottomConstraint = [self.messageBubbleView autoPinBottomToSuperviewMarginWithInset:0];
@ -235,8 +235,8 @@ NS_ASSUME_NONNULL_BEGIN
]]; ]];
[self.viewConstraints addObjectsFromArray:@[ [self.viewConstraints addObjectsFromArray:@[
[self.moderatorIconView autoPinEdge:ALEdgeTrailing toEdge:ALEdgeTrailing ofView:self.avatarView], [self.moderatorIconImageView autoPinEdge:ALEdgeTrailing toEdge:ALEdgeTrailing ofView:self.avatarView],
[self.moderatorIconView autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.avatarView withOffset:3.5] [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) { if (self.viewItem.isGroupThread && !self.viewItem.isRSSFeed) {
BOOL isModerator = [LKGroupChatAPI isUserModerator:incomingMessage.authorId forGroup:LKGroupChatAPI.publicChatServerID onServer:LKGroupChatAPI.publicChatServer]; BOOL isModerator = [LKGroupChatAPI isUserModerator:incomingMessage.authorId forGroup:LKGroupChatAPI.publicChatServerID onServer:LKGroupChatAPI.publicChatServer];
UIImage *moderatorIcon = [UIImage imageNamed:@"Crown"]; UIImage *moderatorIcon = [UIImage imageNamed:@"Crown"];
self.moderatorIconView.image = moderatorIcon; self.moderatorIconImageView.image = moderatorIcon;
self.moderatorIconView.hidden = !isModerator; self.moderatorIconImageView.hidden = !isModerator;
} }
[self.contentView addSubview:self.moderatorIconView]; [self.contentView addSubview:self.moderatorIconImageView];
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(otherUsersProfileDidChange:) selector:@selector(otherUsersProfileDidChange:)
@ -405,8 +405,8 @@ NS_ASSUME_NONNULL_BEGIN
self.avatarView.image = nil; self.avatarView.image = nil;
[self.avatarView removeFromSuperview]; [self.avatarView removeFromSuperview];
self.moderatorIconView.image = nil; self.moderatorIconImageView.image = nil;
[self.moderatorIconView removeFromSuperview]; [self.moderatorIconImageView removeFromSuperview];
[self.sendFailureBadgeView removeFromSuperview]; [self.sendFailureBadgeView removeFromSuperview];
self.sendFailureBadgeView = nil; self.sendFailureBadgeView = nil;

@ -123,7 +123,7 @@ NS_ASSUME_NONNULL_BEGIN
[MessageRecipientStatusUtils recipientStatusWithOutgoingMessage:outgoingMessage]; [MessageRecipientStatusUtils recipientStatusWithOutgoingMessage:outgoingMessage];
switch (messageStatus) { switch (messageStatus) {
case MessageReceiptStatusCalculatingPoW: case MessageReceiptStatusCalculatingPoW:
statusIndicatorImage = [UIImage imageNamed:@"message_status_pow"]; statusIndicatorImage = [UIImage imageNamed:@"Cog"];
[self animateSpinningIcon]; [self animateSpinningIcon];
break; break;
case MessageReceiptStatusUploading: case MessageReceiptStatusUploading:

@ -616,6 +616,7 @@ typedef enum : NSUInteger {
[self applyTheme]; [self applyTheme];
[self.conversationViewModel viewDidLoad]; [self.conversationViewModel viewDidLoad];
// Loki: Track events
if (self.thread.isGroupThread) { if (self.thread.isGroupThread) {
if (self.isRSSFeed) { if (self.isRSSFeed) {
[LKAnalytics.shared track:@"RSS Feed Opened"]; [LKAnalytics.shared track:@"RSS Feed Opened"];

@ -309,7 +309,7 @@ NS_ASSUME_NONNULL_BEGIN
[MessageRecipientStatusUtils recipientStatusWithOutgoingMessage:outgoingMessage]; [MessageRecipientStatusUtils recipientStatusWithOutgoingMessage:outgoingMessage];
switch (messageStatus) { switch (messageStatus) {
case MessageReceiptStatusCalculatingPoW: case MessageReceiptStatusCalculatingPoW:
statusIndicatorImage = [UIImage imageNamed:@"message_status_pow"]; statusIndicatorImage = [UIImage imageNamed:@"Cog"];
shouldAnimateStatusIcon = YES; shouldAnimateStatusIcon = YES;
break; break;
case MessageReceiptStatusUploading: case MessageReceiptStatusUploading:

@ -1428,7 +1428,7 @@ typedef NS_ENUM(NSInteger, HomeViewControllerSection) {
[thread removeWithTransaction:transaction]; [thread removeWithTransaction:transaction];
}]; }];
// Loki - Post notification // Loki: Post notification
[[NSNotificationCenter defaultCenter] postNotificationName:NSNotification.threadDeleted object:nil userInfo:@{ @"threadId": thread.uniqueId }]; [[NSNotificationCenter defaultCenter] postNotificationName:NSNotification.threadDeleted object:nil userInfo:@{ @"threadId": thread.uniqueId }];
[self updateViewState]; [self updateViewState];

@ -18,7 +18,7 @@ public class LoadingViewController: UIViewController {
self.view = UIView() self.view = UIView()
view.backgroundColor = UIColor.lokiDarkestGray() view.backgroundColor = UIColor.lokiDarkestGray()
self.logoView = UIImageView(image: #imageLiteral(resourceName: "LokiLogo")) self.logoView = UIImageView(image: #imageLiteral(resourceName: "Loki"))
view.addSubview(logoView) view.addSubview(logoView)
logoView.autoCenterInSuperview() logoView.autoCenterInSuperview()

@ -401,6 +401,8 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
return; return;
} }
[LKAnalytics.shared track:@"Display Name Updated"];
// Show an activity indicator to block the UI during the profile upload. // Show an activity indicator to block the UI during the profile upload.
[ModalActivityIndicatorViewController [ModalActivityIndicatorViewController
presentFromViewController:self presentFromViewController:self

@ -19,7 +19,7 @@ public class OnboardingSplashViewController: OnboardingBaseViewController {
titleLabel.autoPinEdges(toSuperviewMarginsExcludingEdge: .bottom) titleLabel.autoPinEdges(toSuperviewMarginsExcludingEdge: .bottom)
titleLabel.accessibilityIdentifier = "onboarding.splash." + "titleLabel" titleLabel.accessibilityIdentifier = "onboarding.splash." + "titleLabel"
let lokiLogo = UIImage(named: "LokiLogo") let lokiLogo = UIImage(named: "Loki")
let lokiLogoImageView = UIImageView(image: lokiLogo) let lokiLogoImageView = UIImageView(image: lokiLogo)
lokiLogoImageView.accessibilityIdentifier = "onboarding.splash." + "lokiLogoImageView" lokiLogoImageView.accessibilityIdentifier = "onboarding.splash." + "lokiLogoImageView"
lokiLogoImageView.autoSetDimension(.height, toSize: 71) lokiLogoImageView.autoSetDimension(.height, toSize: 71)
@ -72,6 +72,8 @@ public class OnboardingSplashViewController: OnboardingBaseViewController {
stackView.autoPin(toTopLayoutGuideOf: self, withInset: 0) stackView.autoPin(toTopLayoutGuideOf: self, withInset: 0)
stackView.autoPin(toBottomLayoutGuideOf: self, withInset: 0) stackView.autoPin(toBottomLayoutGuideOf: self, withInset: 0)
lokiLogoImageView.autoCenterInSuperview() lokiLogoImageView.autoCenterInSuperview()
Analytics.shared.track("Landing Screen Viewed")
} }
// MARK: - Events // MARK: - Events

@ -292,6 +292,8 @@ const CGFloat kIconViewLength = 24;
#endif #endif
[self updateTableContents]; [self updateTableContents];
[LKAnalytics.shared track:@"Conversation Settings Opened"];
} }
- (void)viewDidAppear:(BOOL)animated - (void)viewDidAppear:(BOOL)animated

@ -1,11 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
@ -18,11 +14,11 @@
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/> <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LokiLogo" translatesAutoresizingMaskIntoConstraints="NO" id="b92-yg-YYQ"> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Loki" translatesAutoresizingMaskIntoConstraints="NO" id="b92-yg-YYQ">
<rect key="frame" x="150" y="298" width="75" height="71"/> <rect key="frame" x="262.5" y="264.5" width="75" height="71"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="75" id="edg-p1-IeH"/> <constraint firstAttribute="width" constant="75" id="edg-p1-IeH"/>
<constraint firstAttribute="height" constant="71" id="sRe-w6-smO"/> <constraint firstAttribute="height" constant="71" id="sRe-w6-smO"/>
@ -42,6 +38,6 @@
</scene> </scene>
</scenes> </scenes>
<resources> <resources>
<image name="LokiLogo" width="1057" height="1000"/> <image name="Loki" width="16" height="16"/>
</resources> </resources>
</document> </document>

@ -145,6 +145,6 @@ public class JazzIcon {
private func hueShift(colours: [UIColor]) -> [UIColor] { private func hueShift(colours: [UIColor]) -> [UIColor] {
let amount = generator.nextCGFloat() * 30 - CGFloat(wobble / 2); let amount = generator.nextCGFloat() * 30 - CGFloat(wobble / 2);
return colours.map { $0.adjust(hueBy: amount) } return colours.map { $0.adjustHue(by: amount) }
} }
} }

@ -1,7 +1,7 @@
extension UIColor { extension UIColor {
public func adjust(hueBy degrees: CGFloat) -> UIColor { public func adjustHue(by degrees: CGFloat) -> UIColor {
var currentHue: CGFloat = 0.0 var currentHue: CGFloat = 0.0
var currentSaturation: CGFloat = 0.0 var currentSaturation: CGFloat = 0.0

@ -45,7 +45,7 @@ NSString *NSStringForScreenLockUIState(ScreenLockUIState value)
[edgesView autoPinEdgeToSuperviewEdge:ALEdgeBottom]; [edgesView autoPinEdgeToSuperviewEdge:ALEdgeBottom];
[edgesView autoPinWidthToSuperview]; [edgesView autoPinWidthToSuperview];
UIImage *image = [UIImage imageNamed:@"LokiLogo"]; UIImage *image = [UIImage imageNamed:@"Loki"];
UIImageView *imageView = [UIImageView new]; UIImageView *imageView = [UIImageView new];
imageView.image = image; imageView.image = image;
[edgesView addSubview:imageView]; [edgesView addSubview:imageView];

@ -29,7 +29,7 @@ public class CreatePreKeysOperation: OWSOperation {
// Loki: We don't generate PreKeyRecords here. // 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. // 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. // You can use `getOrCreatePreKeyForContact:` to generate one if needed.
let signedPreKeyRecord = primaryStorage.generateRandomSignedRecord() let signedPreKeyRecord = primaryStorage.generateRandomSignedRecord()
signedPreKeyRecord.markAsAcceptedByService() signedPreKeyRecord.markAsAcceptedByService()

@ -65,6 +65,7 @@
} }
#pragma mark Settings #pragma mark Settings
- (uint)ttl { 8 * kMinuteInMs; }
- (BOOL)shouldSyncTranscript { return NO; } - (BOOL)shouldSyncTranscript { return NO; }
- (BOOL)shouldBeSaved { return NO; } - (BOOL)shouldBeSaved { return NO; }

@ -1404,7 +1404,6 @@ NS_ASSUME_NONNULL_BEGIN
} }
// Loki: Don't process friend requests in group chats // Loki: Don't process friend requests in group chats
if (body.length == 0 && attachmentPointers.count < 1 && !contact) { if (body.length == 0 && attachmentPointers.count < 1 && !contact) {
OWSLogWarn(@"ignoring empty incoming message from: %@ for group: %@ with timestamp: %lu", OWSLogWarn(@"ignoring empty incoming message from: %@ for group: %@ with timestamp: %lu",
envelopeAddress(envelope), envelopeAddress(envelope),

Loading…
Cancel
Save