Continue conversion of app setup.

This commit is contained in:
Matthew Chen 2017-12-04 12:38:44 -05:00
parent e56475d929
commit 9da165b846
62 changed files with 621 additions and 749 deletions

View File

@ -55,14 +55,6 @@
346129731FD1E01700532771 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 451DE9F11DC1585F00810E42 /* PromiseKit.framework */; };
346129741FD1E02D00532771 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 451DE9F11DC1585F00810E42 /* PromiseKit.framework */; };
346129761FD1E0B500532771 /* WeakTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346129751FD1E0B500532771 /* WeakTimer.swift */; };
346129891FD1E2AB00532771 /* OWS100RemoveTSRecipientsMigration.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129791FD1E2AB00532771 /* OWS100RemoveTSRecipientsMigration.m */; };
3461298A1FD1E2AB00532771 /* OWS101ExistingUsersBlockOnIdentityChange.m in Sources */ = {isa = PBXBuildFile; fileRef = 3461297B1FD1E2AB00532771 /* OWS101ExistingUsersBlockOnIdentityChange.m */; };
3461298B1FD1E2AB00532771 /* OWS102MoveLoggingPreferenceToUserDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = 3461297D1FD1E2AB00532771 /* OWS102MoveLoggingPreferenceToUserDefaults.m */; };
3461298C1FD1E2AB00532771 /* OWS103EnableVideoCalling.m in Sources */ = {isa = PBXBuildFile; fileRef = 3461297F1FD1E2AB00532771 /* OWS103EnableVideoCalling.m */; };
3461298D1FD1E2AB00532771 /* OWS104CreateRecipientIdentities.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129811FD1E2AB00532771 /* OWS104CreateRecipientIdentities.m */; };
3461298E1FD1E2AB00532771 /* OWS105AttachmentFilePaths.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129831FD1E2AB00532771 /* OWS105AttachmentFilePaths.m */; };
3461298F1FD1E2AB00532771 /* OWS106EnsureProfileComplete.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346129841FD1E2AB00532771 /* OWS106EnsureProfileComplete.swift */; };
346129911FD1E2AB00532771 /* OWSDatabaseMigrationRunner.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129881FD1E2AB00532771 /* OWSDatabaseMigrationRunner.m */; };
346129951FD1E30000532771 /* OWSDatabaseMigration.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129931FD1E30000532771 /* OWSDatabaseMigration.h */; settings = {ATTRIBUTES = (Public, ); }; };
346129961FD1E30000532771 /* OWSDatabaseMigration.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129941FD1E30000532771 /* OWSDatabaseMigration.m */; };
346129991FD1E4DA00532771 /* SignalApp.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129971FD1E4D900532771 /* SignalApp.m */; };
@ -77,7 +69,7 @@
346129B51FD1F7E800532771 /* OWSProfileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129B21FD1F7E800532771 /* OWSProfileManager.m */; };
346129B61FD1F7E800532771 /* ProfileFetcherJob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346129B31FD1F7E800532771 /* ProfileFetcherJob.swift */; };
346129BF1FD2068600532771 /* ThreadUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129BE1FD2068600532771 /* ThreadUtil.m */; };
346129C71FD2072E00532771 /* NSString+OWS.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129C01FD2072C00532771 /* NSString+OWS.h */; };
346129C71FD2072E00532771 /* NSString+OWS.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129C01FD2072C00532771 /* NSString+OWS.h */; settings = {ATTRIBUTES = (Public, ); }; };
346129C81FD2072E00532771 /* NSAttributedString+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129C11FD2072D00532771 /* NSAttributedString+OWS.m */; };
346129C91FD2072E00532771 /* NSString+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129C21FD2072D00532771 /* NSString+OWS.m */; };
346129CA1FD2072E00532771 /* UIImage+OWS.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129C31FD2072D00532771 /* UIImage+OWS.h */; };
@ -88,6 +80,27 @@
346129D21FD2085A00532771 /* CommonStrings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346129D11FD2085A00532771 /* CommonStrings.swift */; };
346129D51FD20ADC00532771 /* UIViewController+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129D31FD20ADB00532771 /* UIViewController+OWS.m */; };
346129D61FD20ADC00532771 /* UIViewController+OWS.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129D41FD20ADC00532771 /* UIViewController+OWS.h */; settings = {ATTRIBUTES = (Public, ); }; };
346129D91FD5B84900532771 /* SAECallMessageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346129D71FD5B84800532771 /* SAECallMessageHandler.swift */; };
346129DA1FD5B84900532771 /* SAENotificationsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346129D81FD5B84900532771 /* SAENotificationsManager.swift */; };
346129DE1FD5C02A00532771 /* LockInteractionController.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129DC1FD5C02900532771 /* LockInteractionController.h */; };
346129DF1FD5C02A00532771 /* LockInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129DD1FD5C02900532771 /* LockInteractionController.m */; };
346129E21FD5C0BE00532771 /* VersionMigrations.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129E01FD5C0BE00532771 /* VersionMigrations.h */; };
346129E31FD5C0BE00532771 /* VersionMigrations.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129E11FD5C0BE00532771 /* VersionMigrations.m */; };
346129E61FD5C0C600532771 /* OWSDatabaseMigrationRunner.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129E41FD5C0C600532771 /* OWSDatabaseMigrationRunner.m */; };
346129E71FD5C0C600532771 /* OWSDatabaseMigrationRunner.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129E51FD5C0C600532771 /* OWSDatabaseMigrationRunner.h */; };
346129F51FD5F31400532771 /* OWS102MoveLoggingPreferenceToUserDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129E81FD5F31200532771 /* OWS102MoveLoggingPreferenceToUserDefaults.m */; };
346129F61FD5F31400532771 /* OWS103EnableVideoCalling.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129E91FD5F31300532771 /* OWS103EnableVideoCalling.h */; };
346129F71FD5F31400532771 /* OWS105AttachmentFilePaths.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129EA1FD5F31300532771 /* OWS105AttachmentFilePaths.m */; };
346129F81FD5F31400532771 /* OWS100RemoveTSRecipientsMigration.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129EB1FD5F31300532771 /* OWS100RemoveTSRecipientsMigration.m */; };
346129F91FD5F31400532771 /* OWS104CreateRecipientIdentities.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129EC1FD5F31300532771 /* OWS104CreateRecipientIdentities.m */; };
346129FA1FD5F31400532771 /* OWS100RemoveTSRecipientsMigration.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129ED1FD5F31300532771 /* OWS100RemoveTSRecipientsMigration.h */; };
346129FB1FD5F31400532771 /* OWS101ExistingUsersBlockOnIdentityChange.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129EE1FD5F31300532771 /* OWS101ExistingUsersBlockOnIdentityChange.m */; };
346129FC1FD5F31400532771 /* OWS101ExistingUsersBlockOnIdentityChange.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129EF1FD5F31400532771 /* OWS101ExistingUsersBlockOnIdentityChange.h */; };
346129FD1FD5F31400532771 /* OWS102MoveLoggingPreferenceToUserDefaults.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129F01FD5F31400532771 /* OWS102MoveLoggingPreferenceToUserDefaults.h */; };
346129FE1FD5F31400532771 /* OWS106EnsureProfileComplete.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346129F11FD5F31400532771 /* OWS106EnsureProfileComplete.swift */; };
346129FF1FD5F31400532771 /* OWS103EnableVideoCalling.m in Sources */ = {isa = PBXBuildFile; fileRef = 346129F21FD5F31400532771 /* OWS103EnableVideoCalling.m */; };
34612A001FD5F31400532771 /* OWS105AttachmentFilePaths.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129F31FD5F31400532771 /* OWS105AttachmentFilePaths.h */; };
34612A011FD5F31400532771 /* OWS104CreateRecipientIdentities.h in Headers */ = {isa = PBXBuildFile; fileRef = 346129F41FD5F31400532771 /* OWS104CreateRecipientIdentities.h */; };
346B66311F4E29B200E5122F /* CropScaleImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346B66301F4E29B200E5122F /* CropScaleImageViewController.swift */; };
3471B1DA1EB7C63600F6AEC8 /* NewNonContactConversationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3471B1D91EB7C63600F6AEC8 /* NewNonContactConversationViewController.m */; };
3472229F1EB22FFE00E53955 /* AddToGroupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3472229E1EB22FFE00E53955 /* AddToGroupViewController.m */; };
@ -108,7 +121,6 @@
34B3F87D1E8DF1700035BE1A /* FullImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8481E8DF1700035BE1A /* FullImageViewController.m */; };
34B3F87E1E8DF1700035BE1A /* InboxTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F84A1E8DF1700035BE1A /* InboxTableViewCell.m */; };
34B3F8801E8DF1700035BE1A /* InviteFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F84C1E8DF1700035BE1A /* InviteFlow.swift */; };
34B3F8811E8DF1700035BE1A /* LockInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F84E1E8DF1700035BE1A /* LockInteractionController.m */; };
34B3F8821E8DF1700035BE1A /* NewContactThreadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8501E8DF1700035BE1A /* NewContactThreadViewController.m */; };
34B3F8851E8DF1700035BE1A /* NewGroupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8551E8DF1700035BE1A /* NewGroupViewController.m */; };
34B3F8861E8DF1700035BE1A /* NotificationSettingsOptionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8571E8DF1700035BE1A /* NotificationSettingsOptionsViewController.m */; };
@ -314,8 +326,6 @@
76EB054018170B33006006FC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB03C318170B33006006FC /* AppDelegate.m */; };
76EB063A18170B33006006FC /* FunctionalUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04EB18170B33006006FC /* FunctionalUtil.m */; };
76EB063C18170B33006006FC /* NumberUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04ED18170B33006006FC /* NumberUtil.m */; };
76EB063E18170B33006006FC /* Operation.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04EF18170B33006006FC /* Operation.m */; };
76EB064218170B33006006FC /* StringUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04F618170B33006006FC /* StringUtil.m */; };
76EB068618170B34006006FC /* ContactTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB052F18170B33006006FC /* ContactTableViewCell.m */; };
954AEE6A1DF33E01002E5410 /* ContactsPickerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 954AEE681DF33D32002E5410 /* ContactsPickerTest.swift */; };
A10FDF79184FB4BB007FF963 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76C87F18181EFCE600C4ACAB /* MediaPlayer.framework */; };
@ -344,7 +354,6 @@
B10C9B611A7049EC00ECA2BF /* play_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B10C9B5D1A7049EC00ECA2BF /* play_icon.png */; };
B10C9B621A7049EC00ECA2BF /* play_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B10C9B5E1A7049EC00ECA2BF /* play_icon@2x.png */; };
B609597C1C2C0FC6004E8797 /* iRate.m in Sources */ = {isa = PBXBuildFile; fileRef = B609597B1C2C0FC6004E8797 /* iRate.m */; };
B60C16651988999D00E97A6C /* VersionMigrations.m in Sources */ = {isa = PBXBuildFile; fileRef = B60C16641988999D00E97A6C /* VersionMigrations.m */; };
B60EDE041A05A01700D73516 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B60EDE031A05A01700D73516 /* AudioToolbox.framework */; };
B625CD561ABB589C00E8B23C /* NewMessage.aifc in Resources */ = {isa = PBXBuildFile; fileRef = B625CD551ABB589C00E8B23C /* NewMessage.aifc */; };
B633C5861A1D190B0059AC12 /* call@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B633C5041A1D190B0059AC12 /* call@2x.png */; };
@ -360,13 +369,11 @@
B660F6DA1C29868000687D6E /* ExceptionsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F6AB1C29868000687D6E /* ExceptionsTest.m */; };
B660F6DB1C29868000687D6E /* FunctionalUtilTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F6AD1C29868000687D6E /* FunctionalUtilTest.m */; };
B660F6E01C29868000687D6E /* UtilTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B660F6B41C29868000687D6E /* UtilTest.m */; };
B660F7221C29988E00687D6E /* VersionMigrations.m in Sources */ = {isa = PBXBuildFile; fileRef = B60C16641988999D00E97A6C /* VersionMigrations.m */; };
B660F7561C29988E00687D6E /* PushManager.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B9ECFB198B31BA00C620D3 /* PushManager.m */; };
B660F7721C29988E00687D6E /* AppStoreRating.m in Sources */ = {isa = PBXBuildFile; fileRef = B6DA6B061B8A2F9A00CA6F98 /* AppStoreRating.m */; };
B660F77F1C29988E00687D6E /* DateUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B90418E5183E9DD40038554A /* DateUtil.m */; };
B660F7811C29988E00687D6E /* FunctionalUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04EB18170B33006006FC /* FunctionalUtil.m */; };
B660F7831C29988E00687D6E /* NumberUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04ED18170B33006006FC /* NumberUtil.m */; };
B660F7871C29988E00687D6E /* StringUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB04F618170B33006006FC /* StringUtil.m */; };
B660F78A1C29988E00687D6E /* UIUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B97940261832BD2400BD66CB /* UIUtil.m */; };
B660F78C1C29988E00687D6E /* UIDevice+TSHardwareVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = FCC81A971A44558300DFEC7D /* UIDevice+TSHardwareVersion.m */; };
B66DBF4A19D5BBC8006EA940 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B66DBF4919D5BBC8006EA940 /* Images.xcassets */; };
@ -577,21 +584,6 @@
346129581FD1D74B00532771 /* SignalKeyingStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SignalKeyingStorage.h; sourceTree = "<group>"; };
346129591FD1D74B00532771 /* SignalKeyingStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignalKeyingStorage.m; sourceTree = "<group>"; };
346129751FD1E0B500532771 /* WeakTimer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WeakTimer.swift; sourceTree = "<group>"; };
346129781FD1E2AB00532771 /* OWS100RemoveTSRecipientsMigration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWS100RemoveTSRecipientsMigration.h; sourceTree = "<group>"; };
346129791FD1E2AB00532771 /* OWS100RemoveTSRecipientsMigration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWS100RemoveTSRecipientsMigration.m; sourceTree = "<group>"; };
3461297A1FD1E2AB00532771 /* OWS101ExistingUsersBlockOnIdentityChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWS101ExistingUsersBlockOnIdentityChange.h; sourceTree = "<group>"; };
3461297B1FD1E2AB00532771 /* OWS101ExistingUsersBlockOnIdentityChange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWS101ExistingUsersBlockOnIdentityChange.m; sourceTree = "<group>"; };
3461297C1FD1E2AB00532771 /* OWS102MoveLoggingPreferenceToUserDefaults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWS102MoveLoggingPreferenceToUserDefaults.h; sourceTree = "<group>"; };
3461297D1FD1E2AB00532771 /* OWS102MoveLoggingPreferenceToUserDefaults.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWS102MoveLoggingPreferenceToUserDefaults.m; sourceTree = "<group>"; };
3461297E1FD1E2AB00532771 /* OWS103EnableVideoCalling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWS103EnableVideoCalling.h; sourceTree = "<group>"; };
3461297F1FD1E2AB00532771 /* OWS103EnableVideoCalling.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWS103EnableVideoCalling.m; sourceTree = "<group>"; };
346129801FD1E2AB00532771 /* OWS104CreateRecipientIdentities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWS104CreateRecipientIdentities.h; sourceTree = "<group>"; };
346129811FD1E2AB00532771 /* OWS104CreateRecipientIdentities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWS104CreateRecipientIdentities.m; sourceTree = "<group>"; };
346129821FD1E2AB00532771 /* OWS105AttachmentFilePaths.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWS105AttachmentFilePaths.h; sourceTree = "<group>"; };
346129831FD1E2AB00532771 /* OWS105AttachmentFilePaths.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWS105AttachmentFilePaths.m; sourceTree = "<group>"; };
346129841FD1E2AB00532771 /* OWS106EnsureProfileComplete.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OWS106EnsureProfileComplete.swift; sourceTree = "<group>"; };
346129871FD1E2AB00532771 /* OWSDatabaseMigrationRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSDatabaseMigrationRunner.h; sourceTree = "<group>"; };
346129881FD1E2AB00532771 /* OWSDatabaseMigrationRunner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSDatabaseMigrationRunner.m; sourceTree = "<group>"; };
346129931FD1E30000532771 /* OWSDatabaseMigration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSDatabaseMigration.h; sourceTree = "<group>"; };
346129941FD1E30000532771 /* OWSDatabaseMigration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSDatabaseMigration.m; sourceTree = "<group>"; };
346129971FD1E4D900532771 /* SignalApp.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignalApp.m; sourceTree = "<group>"; };
@ -620,6 +612,27 @@
346129D11FD2085A00532771 /* CommonStrings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommonStrings.swift; sourceTree = "<group>"; };
346129D31FD20ADB00532771 /* UIViewController+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+OWS.m"; sourceTree = "<group>"; };
346129D41FD20ADC00532771 /* UIViewController+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+OWS.h"; sourceTree = "<group>"; };
346129D71FD5B84800532771 /* SAECallMessageHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SAECallMessageHandler.swift; sourceTree = "<group>"; };
346129D81FD5B84900532771 /* SAENotificationsManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SAENotificationsManager.swift; sourceTree = "<group>"; };
346129DC1FD5C02900532771 /* LockInteractionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LockInteractionController.h; sourceTree = "<group>"; };
346129DD1FD5C02900532771 /* LockInteractionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LockInteractionController.m; sourceTree = "<group>"; };
346129E01FD5C0BE00532771 /* VersionMigrations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VersionMigrations.h; sourceTree = "<group>"; };
346129E11FD5C0BE00532771 /* VersionMigrations.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VersionMigrations.m; sourceTree = "<group>"; };
346129E41FD5C0C600532771 /* OWSDatabaseMigrationRunner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSDatabaseMigrationRunner.m; sourceTree = "<group>"; };
346129E51FD5C0C600532771 /* OWSDatabaseMigrationRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSDatabaseMigrationRunner.h; sourceTree = "<group>"; };
346129E81FD5F31200532771 /* OWS102MoveLoggingPreferenceToUserDefaults.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWS102MoveLoggingPreferenceToUserDefaults.m; sourceTree = "<group>"; };
346129E91FD5F31300532771 /* OWS103EnableVideoCalling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWS103EnableVideoCalling.h; sourceTree = "<group>"; };
346129EA1FD5F31300532771 /* OWS105AttachmentFilePaths.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWS105AttachmentFilePaths.m; sourceTree = "<group>"; };
346129EB1FD5F31300532771 /* OWS100RemoveTSRecipientsMigration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWS100RemoveTSRecipientsMigration.m; sourceTree = "<group>"; };
346129EC1FD5F31300532771 /* OWS104CreateRecipientIdentities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWS104CreateRecipientIdentities.m; sourceTree = "<group>"; };
346129ED1FD5F31300532771 /* OWS100RemoveTSRecipientsMigration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWS100RemoveTSRecipientsMigration.h; sourceTree = "<group>"; };
346129EE1FD5F31300532771 /* OWS101ExistingUsersBlockOnIdentityChange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWS101ExistingUsersBlockOnIdentityChange.m; sourceTree = "<group>"; };
346129EF1FD5F31400532771 /* OWS101ExistingUsersBlockOnIdentityChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWS101ExistingUsersBlockOnIdentityChange.h; sourceTree = "<group>"; };
346129F01FD5F31400532771 /* OWS102MoveLoggingPreferenceToUserDefaults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWS102MoveLoggingPreferenceToUserDefaults.h; sourceTree = "<group>"; };
346129F11FD5F31400532771 /* OWS106EnsureProfileComplete.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OWS106EnsureProfileComplete.swift; sourceTree = "<group>"; };
346129F21FD5F31400532771 /* OWS103EnableVideoCalling.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWS103EnableVideoCalling.m; sourceTree = "<group>"; };
346129F31FD5F31400532771 /* OWS105AttachmentFilePaths.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWS105AttachmentFilePaths.h; sourceTree = "<group>"; };
346129F41FD5F31400532771 /* OWS104CreateRecipientIdentities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWS104CreateRecipientIdentities.h; sourceTree = "<group>"; };
346B66301F4E29B200E5122F /* CropScaleImageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CropScaleImageViewController.swift; sourceTree = "<group>"; };
3471B1D81EB7C63600F6AEC8 /* NewNonContactConversationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewNonContactConversationViewController.h; sourceTree = "<group>"; };
3471B1D91EB7C63600F6AEC8 /* NewNonContactConversationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewNonContactConversationViewController.m; sourceTree = "<group>"; };
@ -655,8 +668,6 @@
34B3F8491E8DF1700035BE1A /* InboxTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InboxTableViewCell.h; sourceTree = "<group>"; };
34B3F84A1E8DF1700035BE1A /* InboxTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InboxTableViewCell.m; sourceTree = "<group>"; };
34B3F84C1E8DF1700035BE1A /* InviteFlow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InviteFlow.swift; sourceTree = "<group>"; };
34B3F84D1E8DF1700035BE1A /* LockInteractionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LockInteractionController.h; sourceTree = "<group>"; };
34B3F84E1E8DF1700035BE1A /* LockInteractionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LockInteractionController.m; sourceTree = "<group>"; };
34B3F84F1E8DF1700035BE1A /* NewContactThreadViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewContactThreadViewController.h; sourceTree = "<group>"; };
34B3F8501E8DF1700035BE1A /* NewContactThreadViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewContactThreadViewController.m; sourceTree = "<group>"; };
34B3F8541E8DF1700035BE1A /* NewGroupViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewGroupViewController.h; sourceTree = "<group>"; };
@ -901,11 +912,6 @@
76EB04EB18170B33006006FC /* FunctionalUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FunctionalUtil.m; sourceTree = "<group>"; };
76EB04EC18170B33006006FC /* NumberUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumberUtil.h; sourceTree = "<group>"; };
76EB04ED18170B33006006FC /* NumberUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NumberUtil.m; sourceTree = "<group>"; };
76EB04EE18170B33006006FC /* Operation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Operation.h; sourceTree = "<group>"; };
76EB04EF18170B33006006FC /* Operation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Operation.m; sourceTree = "<group>"; };
76EB04F518170B33006006FC /* StringUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringUtil.h; sourceTree = "<group>"; };
76EB04F618170B33006006FC /* StringUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StringUtil.m; sourceTree = "<group>"; };
76EB04FB18170B33006006FC /* Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Util.h; sourceTree = "<group>"; };
76EB052E18170B33006006FC /* ContactTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactTableViewCell.h; sourceTree = "<group>"; };
76EB052F18170B33006006FC /* ContactTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactTableViewCell.m; sourceTree = "<group>"; };
8981C8F64D94D3C52EB67A2C /* Pods-SignalTests.test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SignalTests.test.xcconfig"; path = "Pods/Target Support Files/Pods-SignalTests/Pods-SignalTests.test.xcconfig"; sourceTree = "<group>"; };
@ -937,8 +943,6 @@
B60341CD1AA5469800A01E42 /* ja_JP */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja_JP; path = translations/ja_JP.lproj/Localizable.strings; sourceTree = "<group>"; };
B609597A1C2C0FC6004E8797 /* iRate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = iRate.h; path = Libraries/iRate/iRate.h; sourceTree = SOURCE_ROOT; };
B609597B1C2C0FC6004E8797 /* iRate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = iRate.m; path = Libraries/iRate/iRate.m; sourceTree = SOURCE_ROOT; };
B60C16631988999D00E97A6C /* VersionMigrations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VersionMigrations.h; sourceTree = "<group>"; };
B60C16641988999D00E97A6C /* VersionMigrations.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VersionMigrations.m; sourceTree = "<group>"; };
B60EDE031A05A01700D73516 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
B625CD551ABB589C00E8B23C /* NewMessage.aifc */ = {isa = PBXFileReference; lastKnownFileType = file; path = NewMessage.aifc; sourceTree = "<group>"; };
B633C5041A1D190B0059AC12 /* call@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "call@2x.png"; sourceTree = "<group>"; };
@ -1216,37 +1220,32 @@
346129571FD1D74B00532771 /* Release.m */,
346129581FD1D74B00532771 /* SignalKeyingStorage.h */,
346129591FD1D74B00532771 /* SignalKeyingStorage.m */,
346129E01FD5C0BE00532771 /* VersionMigrations.h */,
346129E11FD5C0BE00532771 /* VersionMigrations.m */,
);
path = environment;
sourceTree = "<group>";
};
346129771FD1E2AB00532771 /* Migrations */ = {
isa = PBXGroup;
children = (
346129781FD1E2AB00532771 /* OWS100RemoveTSRecipientsMigration.h */,
346129791FD1E2AB00532771 /* OWS100RemoveTSRecipientsMigration.m */,
3461297A1FD1E2AB00532771 /* OWS101ExistingUsersBlockOnIdentityChange.h */,
3461297B1FD1E2AB00532771 /* OWS101ExistingUsersBlockOnIdentityChange.m */,
3461297C1FD1E2AB00532771 /* OWS102MoveLoggingPreferenceToUserDefaults.h */,
3461297D1FD1E2AB00532771 /* OWS102MoveLoggingPreferenceToUserDefaults.m */,
3461297E1FD1E2AB00532771 /* OWS103EnableVideoCalling.h */,
3461297F1FD1E2AB00532771 /* OWS103EnableVideoCalling.m */,
346129801FD1E2AB00532771 /* OWS104CreateRecipientIdentities.h */,
346129811FD1E2AB00532771 /* OWS104CreateRecipientIdentities.m */,
346129821FD1E2AB00532771 /* OWS105AttachmentFilePaths.h */,
346129831FD1E2AB00532771 /* OWS105AttachmentFilePaths.m */,
346129841FD1E2AB00532771 /* OWS106EnsureProfileComplete.swift */,
346129871FD1E2AB00532771 /* OWSDatabaseMigrationRunner.h */,
346129881FD1E2AB00532771 /* OWSDatabaseMigrationRunner.m */,
);
path = Migrations;
sourceTree = "<group>";
};
346129921FD1E30000532771 /* migrations */ = {
isa = PBXGroup;
children = (
346129ED1FD5F31300532771 /* OWS100RemoveTSRecipientsMigration.h */,
346129EB1FD5F31300532771 /* OWS100RemoveTSRecipientsMigration.m */,
346129EF1FD5F31400532771 /* OWS101ExistingUsersBlockOnIdentityChange.h */,
346129EE1FD5F31300532771 /* OWS101ExistingUsersBlockOnIdentityChange.m */,
346129F01FD5F31400532771 /* OWS102MoveLoggingPreferenceToUserDefaults.h */,
346129E81FD5F31200532771 /* OWS102MoveLoggingPreferenceToUserDefaults.m */,
346129E91FD5F31300532771 /* OWS103EnableVideoCalling.h */,
346129F21FD5F31400532771 /* OWS103EnableVideoCalling.m */,
346129F41FD5F31400532771 /* OWS104CreateRecipientIdentities.h */,
346129EC1FD5F31300532771 /* OWS104CreateRecipientIdentities.m */,
346129F31FD5F31400532771 /* OWS105AttachmentFilePaths.h */,
346129EA1FD5F31300532771 /* OWS105AttachmentFilePaths.m */,
346129F11FD5F31400532771 /* OWS106EnsureProfileComplete.swift */,
346129931FD1E30000532771 /* OWSDatabaseMigration.h */,
346129941FD1E30000532771 /* OWSDatabaseMigration.m */,
346129E51FD5C0C600532771 /* OWSDatabaseMigrationRunner.h */,
346129E41FD5C0C600532771 /* OWSDatabaseMigrationRunner.m */,
);
path = migrations;
sourceTree = "<group>";
@ -1280,6 +1279,15 @@
path = views;
sourceTree = "<group>";
};
346129DB1FD5C02900532771 /* viewControllers */ = {
isa = PBXGroup;
children = (
346129DC1FD5C02900532771 /* LockInteractionController.h */,
346129DD1FD5C02900532771 /* LockInteractionController.m */,
);
path = viewControllers;
sourceTree = "<group>";
};
34B3F8331E8DF1700035BE1A /* ViewControllers */ = {
isa = PBXGroup;
children = (
@ -1328,8 +1336,6 @@
34B3F8491E8DF1700035BE1A /* InboxTableViewCell.h */,
34B3F84A1E8DF1700035BE1A /* InboxTableViewCell.m */,
34B3F84C1E8DF1700035BE1A /* InviteFlow.swift */,
34B3F84D1E8DF1700035BE1A /* LockInteractionController.h */,
34B3F84E1E8DF1700035BE1A /* LockInteractionController.m */,
34CA1C281F7164F700E51C51 /* MediaMessageView.swift */,
34CA1C261F7156F300E51C51 /* MessageDetailViewController.swift */,
34D9134C1F66DB7C00722898 /* ModalActivityIndicatorViewController.swift */,
@ -1518,6 +1524,8 @@
children = (
4535186F1FC635DD00210559 /* Info.plist */,
346129051FD1A25B00532771 /* Localizable.strings */,
346129D71FD5B84800532771 /* SAECallMessageHandler.swift */,
346129D81FD5B84900532771 /* SAENotificationsManager.swift */,
4535186C1FC635DD00210559 /* MainInterface.storyboard */,
3461284A1FD0B93F00532771 /* SAELoadViewController.swift */,
4535186A1FC635DD00210559 /* ShareViewController.swift */,
@ -1541,6 +1549,7 @@
453518941FC63DBF00210559 /* SignalMessaging.h */,
453518A01FC63DD500210559 /* StorageCoordinator.swift */,
34480B471FD0A60200BC14EF /* utils */,
346129DB1FD5C02900532771 /* viewControllers */,
346129CE1FD207F200532771 /* views */,
);
path = SignalMessaging;
@ -1688,14 +1697,11 @@
isa = PBXGroup;
children = (
4505C2BD1E648E6E00CEBF41 /* ExperienceUpgrades */,
346129771FD1E2AB00532771 /* Migrations */,
3461299A1FD1EA9E00532771 /* NotificationsManager.h */,
3461299B1FD1EA9E00532771 /* NotificationsManager.m */,
4539B5851F79348F007141FF /* PushRegistrationManager.swift */,
346129981FD1E4DA00532771 /* SignalApp.h */,
346129971FD1E4D900532771 /* SignalApp.m */,
B60C16631988999D00E97A6C /* VersionMigrations.h */,
B60C16641988999D00E97A6C /* VersionMigrations.m */,
);
path = environment;
sourceTree = "<group>";
@ -1728,8 +1734,6 @@
34B0796B1FCF46B000E248C2 /* MainAppContext.m */,
76EB04EC18170B33006006FC /* NumberUtil.h */,
76EB04ED18170B33006006FC /* NumberUtil.m */,
76EB04EE18170B33006006FC /* Operation.h */,
76EB04EF18170B33006006FC /* Operation.m */,
34D99C911F2937CC00D284D6 /* OWSAnalytics.swift */,
34D5CC941EA6AFAD005515DB /* OWSContactsSyncing.h */,
34D5CC951EA6AFAD005515DB /* OWSContactsSyncing.m */,
@ -1737,8 +1741,6 @@
4579431D1E7C8CE9008ED0C0 /* Pastelog.m */,
450DF2041E0D74AC003D14BE /* Platform.swift */,
45360B8C1F9521F800FA666C /* Searcher.swift */,
76EB04F518170B33006006FC /* StringUtil.h */,
76EB04F618170B33006006FC /* StringUtil.m */,
4521C3BF1F59F3BA00B4C582 /* TextFieldHelper.swift */,
346129BD1FD2068600532771 /* ThreadUtil.h */,
346129BE1FD2068600532771 /* ThreadUtil.m */,
@ -1747,7 +1749,6 @@
FCC81A971A44558300DFEC7D /* UIDevice+TSHardwareVersion.m */,
B97940251832BD2400BD66CB /* UIUtil.h */,
B97940261832BD2400BD66CB /* UIUtil.m */,
76EB04FB18170B33006006FC /* Util.h */,
45F170D51E315310003FC1F2 /* Weak.swift */,
45B72DD91FD5E70600151AF6 /* ConversationSearcher.swift */,
);
@ -2062,26 +2063,35 @@
buildActionMask = 2147483647;
files = (
34480B491FD0A60200BC14EF /* OWSMath.h in Headers */,
346129E71FD5C0C600532771 /* OWSDatabaseMigrationRunner.h in Headers */,
34480B521FD0A7A400BC14EF /* OWSLogger.h in Headers */,
34612A001FD5F31400532771 /* OWS105AttachmentFilePaths.h in Headers */,
346129F61FD5F31400532771 /* OWS103EnableVideoCalling.h in Headers */,
346129A91FD1F0E000532771 /* OWSFormat.h in Headers */,
34480B551FD0A7A400BC14EF /* DebugLogger.h in Headers */,
346129CA1FD2072E00532771 /* UIImage+OWS.h in Headers */,
346129711FD1D74C00532771 /* SignalKeyingStorage.h in Headers */,
34612A011FD5F31400532771 /* OWS104CreateRecipientIdentities.h in Headers */,
346129C71FD2072E00532771 /* NSString+OWS.h in Headers */,
346129D61FD20ADC00532771 /* UIViewController+OWS.h in Headers */,
3461296F1FD1D74C00532771 /* Release.h in Headers */,
34480B571FD0A7A400BC14EF /* OWSScrubbingLogFormatter.h in Headers */,
346129FC1FD5F31400532771 /* OWS101ExistingUsersBlockOnIdentityChange.h in Headers */,
346129951FD1E30000532771 /* OWSDatabaseMigration.h in Headers */,
346129B41FD1F7E800532771 /* OWSProfileManager.h in Headers */,
346129FA1FD5F31400532771 /* OWS100RemoveTSRecipientsMigration.h in Headers */,
346129E21FD5C0BE00532771 /* VersionMigrations.h in Headers */,
34480B611FD0A98800BC14EF /* UIColor+OWS.h in Headers */,
453518961FC63DBF00210559 /* SignalMessaging.h in Headers */,
3461295A1FD1D74C00532771 /* Environment.h in Headers */,
34480B631FD0A98800BC14EF /* UIView+OWS.h in Headers */,
346129391FD1B47300532771 /* OWSPreferences.h in Headers */,
346129DE1FD5C02A00532771 /* LockInteractionController.h in Headers */,
34480B5B1FD0A7E300BC14EF /* SignalMessaging-Prefix.pch in Headers */,
346129A51FD1F09100532771 /* OWSContactsManager.h in Headers */,
34480B681FD0AA9400BC14EF /* UIFont+OWS.h in Headers */,
346129CC1FD2072E00532771 /* NSAttributedString+OWS.h in Headers */,
346129FD1FD5F31400532771 /* OWS102MoveLoggingPreferenceToUserDefaults.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2698,8 +2708,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
346129DA1FD5B84900532771 /* SAENotificationsManager.swift in Sources */,
4535186B1FC635DD00210559 /* ShareViewController.swift in Sources */,
34480B361FD0929200BC14EF /* ShareAppExtensionContext.m in Sources */,
346129D91FD5B84900532771 /* SAECallMessageHandler.swift in Sources */,
3461284B1FD0B94000532771 /* SAELoadViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@ -2708,8 +2720,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
346129F71FD5F31400532771 /* OWS105AttachmentFilePaths.m in Sources */,
453518A11FC63DD500210559 /* StorageCoordinator.swift in Sources */,
346129761FD1E0B500532771 /* WeakTimer.swift in Sources */,
346129F81FD5F31400532771 /* OWS100RemoveTSRecipientsMigration.m in Sources */,
346129B51FD1F7E800532771 /* OWSProfileManager.m in Sources */,
346129701FD1D74C00532771 /* Release.m in Sources */,
34480B621FD0A98800BC14EF /* UIColor+OWS.m in Sources */,
@ -2717,19 +2731,27 @@
34480B641FD0A98800BC14EF /* UIView+OWS.m in Sources */,
3461293A1FD1B47300532771 /* OWSPreferences.m in Sources */,
34480B671FD0AA9400BC14EF /* UIFont+OWS.m in Sources */,
346129E61FD5C0C600532771 /* OWSDatabaseMigrationRunner.m in Sources */,
346129AB1FD1F0EE00532771 /* OWSFormat.m in Sources */,
346129961FD1E30000532771 /* OWSDatabaseMigration.m in Sources */,
346129CD1FD2072E00532771 /* UIImage+OWS.m in Sources */,
346129FB1FD5F31400532771 /* OWS101ExistingUsersBlockOnIdentityChange.m in Sources */,
346129AD1FD1F34E00532771 /* ImageCache.swift in Sources */,
346129341FD1A88700532771 /* OWSSwiftUtils.swift in Sources */,
346129FE1FD5F31400532771 /* OWS106EnsureProfileComplete.swift in Sources */,
346129F91FD5F31400532771 /* OWS104CreateRecipientIdentities.m in Sources */,
346129D01FD207F300532771 /* OWSAlerts.swift in Sources */,
346129B61FD1F7E800532771 /* ProfileFetcherJob.swift in Sources */,
346129F51FD5F31400532771 /* OWS102MoveLoggingPreferenceToUserDefaults.m in Sources */,
3461295B1FD1D74C00532771 /* Environment.m in Sources */,
346129D51FD20ADC00532771 /* UIViewController+OWS.m in Sources */,
346129C91FD2072E00532771 /* NSString+OWS.m in Sources */,
346129CB1FD2072E00532771 /* Promise+retainUntilComplete.swift in Sources */,
346129FF1FD5F31400532771 /* OWS103EnableVideoCalling.m in Sources */,
346129E31FD5C0BE00532771 /* VersionMigrations.m in Sources */,
346129A61FD1F09100532771 /* OWSContactsManager.m in Sources */,
346129D21FD2085A00532771 /* CommonStrings.swift in Sources */,
346129DF1FD5C02A00532771 /* LockInteractionController.m in Sources */,
34480B591FD0A7A400BC14EF /* OWSScrubbingLogFormatter.m in Sources */,
346129721FD1D74C00532771 /* SignalKeyingStorage.m in Sources */,
34480B561FD0A7A400BC14EF /* DebugLogger.m in Sources */,
@ -2744,7 +2766,6 @@
buildActionMask = 2147483647;
files = (
34B3F8761E8DF1700035BE1A /* CodeVerificationViewController.m in Sources */,
76EB063E18170B33006006FC /* Operation.m in Sources */,
3461293E1FD1D72B00532771 /* ExperienceUpgradeFinder.swift in Sources */,
34D1F0BD1F8D108C0066283D /* AttachmentUploadView.m in Sources */,
34D1F0BA1F8800D90066283D /* OWSAudioMessageView.m in Sources */,
@ -2762,16 +2783,13 @@
451A13B11E13DED2000A50FD /* CallNotificationsAdapter.swift in Sources */,
450DF2091E0DD2C6003D14BE /* UserNotificationsAdaptee.swift in Sources */,
34D1F0821F8678AA0066283D /* ConversationHeaderView.m in Sources */,
346129911FD1E2AB00532771 /* OWSDatabaseMigrationRunner.m in Sources */,
340CB2241EAC155C0001CAA1 /* ContactsViewHelper.m in Sources */,
45B72DDA1FD5E70600151AF6 /* ConversationSearcher.swift in Sources */,
34D1F0AB1F867BFC0066283D /* OWSContactOffersCell.m in Sources */,
B60C16651988999D00E97A6C /* VersionMigrations.m in Sources */,
343A65981FC4CFE7000477A1 /* ConversationScrollButton.m in Sources */,
B97940271832BD2400BD66CB /* UIUtil.m in Sources */,
34B3F8791E8DF1700035BE1A /* CountryCodeViewController.m in Sources */,
34D1F0A91F867BFC0066283D /* ConversationViewCell.m in Sources */,
3461298B1FD1E2AB00532771 /* OWS102MoveLoggingPreferenceToUserDefaults.m in Sources */,
4505C2BF1E648EA300CEBF41 /* ExperienceUpgrade.swift in Sources */,
34CCAF381F0C0599004084F4 /* AppUpdateNag.m in Sources */,
EF764C351DB67CC5000D9A87 /* UIViewController+Permissions.m in Sources */,
@ -2784,7 +2802,6 @@
34C04D801F6195E6004308B3 /* OWSFlatButton.swift in Sources */,
458DE9D91DEE7B360071BB03 /* OWSWebRTCDataProtos.pb.m in Sources */,
76EB063C18170B33006006FC /* NumberUtil.m in Sources */,
346129891FD1E2AB00532771 /* OWS100RemoveTSRecipientsMigration.m in Sources */,
34CA1C291F7164F700E51C51 /* MediaMessageView.swift in Sources */,
3400C7961EAF99F4008A8584 /* SelectThreadViewController.m in Sources */,
34D5CCB11EAE7E7F005515DB /* SelectRecipientViewController.m in Sources */,
@ -2805,7 +2822,6 @@
451686AB1F520CDA00AC3D4B /* MultiDeviceProfileKeyUpdateJob.swift in Sources */,
45D231771DC7E8F10034FA89 /* SessionResetJob.swift in Sources */,
34D9134D1F66DB7C00722898 /* ModalActivityIndicatorViewController.swift in Sources */,
76EB064218170B33006006FC /* StringUtil.m in Sources */,
452037D11EE84975004E4CDF /* DebugUISessionState.m in Sources */,
D221A09A169C9E5E00537ABF /* main.m in Sources */,
34B3F87B1E8DF1700035BE1A /* ExperienceUpgradesPageViewController.swift in Sources */,
@ -2861,7 +2877,6 @@
45C0DC1B1E68FE9000E04C47 /* UIApplication+OWS.swift in Sources */,
45638BDF1F3DDB2200128435 /* MessageSender+Promise.swift in Sources */,
45F3AEB61DFDE7900080CE33 /* AvatarImageView.swift in Sources */,
3461298A1FD1E2AB00532771 /* OWS101ExistingUsersBlockOnIdentityChange.m in Sources */,
45FBC5C81DF8575700E9B410 /* CallKitCallManager.swift in Sources */,
34B3F8911E8DF1710035BE1A /* ShowGroupMembersViewController.m in Sources */,
4539B5861F79348F007141FF /* PushRegistrationManager.swift in Sources */,
@ -2873,7 +2888,6 @@
45360B8D1F9521F800FA666C /* Searcher.swift in Sources */,
34B3F88D1E8DF1700035BE1A /* OWSQRCodeScanningViewController.m in Sources */,
34BECE2E1F7ABCE000D7438D /* GifPickerViewController.swift in Sources */,
34B3F8811E8DF1700035BE1A /* LockInteractionController.m in Sources */,
34CCAF3B1F0C2748004084F4 /* OWSAddToContactViewController.m in Sources */,
34D1F0C01F8EC1760066283D /* MessageRecipientStatusUtils.swift in Sources */,
45F659731E1BD99C00444429 /* CallKitCallUIAdaptee.swift in Sources */,
@ -2883,10 +2897,8 @@
34D99C8C1F27B13B00D284D6 /* OWSViewController.m in Sources */,
34D1F0841F8678AA0066283D /* ConversationInputToolbar.m in Sources */,
340CB2271EAC25820001CAA1 /* UpdateGroupViewController.m in Sources */,
3461298C1FD1E2AB00532771 /* OWS103EnableVideoCalling.m in Sources */,
34B3F89F1E8DF5490035BE1A /* OWSTableViewController.m in Sources */,
3400C7931EAF89CD008A8584 /* SendExternalFileViewController.m in Sources */,
3461298E1FD1E2AB00532771 /* OWS105AttachmentFilePaths.m in Sources */,
FCC81A981A44558300DFEC7D /* UIDevice+TSHardwareVersion.m in Sources */,
3400C7991EAFB772008A8584 /* ThreadViewHelper.m in Sources */,
76EB054018170B33006006FC /* AppDelegate.m in Sources */,
@ -2913,11 +2925,9 @@
34E8BF381EE9E2FD00F5F4CA /* FingerprintViewScanController.m in Sources */,
346B66311F4E29B200E5122F /* CropScaleImageViewController.swift in Sources */,
45E5A6991F61E6DE001E4A8A /* MarqueeLabel.swift in Sources */,
3461298D1FD1E2AB00532771 /* OWS104CreateRecipientIdentities.m in Sources */,
34D1F0B01F867BFC0066283D /* OWSSystemMessageCell.m in Sources */,
45A663C51F92EC760027B59E /* GroupTableViewCell.swift in Sources */,
34B3F87D1E8DF1700035BE1A /* FullImageViewController.m in Sources */,
3461298F1FD1E2AB00532771 /* OWS106EnsureProfileComplete.swift in Sources */,
34D1F0861F8678AA0066283D /* ConversationViewController.m in Sources */,
B90418E6183E9DD40038554A /* DateUtil.m in Sources */,
459311FC1D75C948008DD4F0 /* OWSDeviceTableViewCell.m in Sources */,
@ -2940,7 +2950,6 @@
451DE9F81DC18C9500810E42 /* AccountManager.swift in Sources */,
451DA3CA1F148A9F008E2423 /* DeviceSleepManager.swift in Sources */,
45BB93391E688E14001E3939 /* UIDevice+featureSupport.swift in Sources */,
B660F7221C29988E00687D6E /* VersionMigrations.m in Sources */,
4521C3C11F59F3BA00B4C582 /* TextFieldHelper.swift in Sources */,
45D231781DC7E8F10034FA89 /* SessionResetJob.swift in Sources */,
458967111DC117CC00E9DD21 /* AccountManagerTest.swift in Sources */,
@ -2970,7 +2979,6 @@
B660F77F1C29988E00687D6E /* DateUtil.m in Sources */,
B660F7811C29988E00687D6E /* FunctionalUtil.m in Sources */,
B660F7831C29988E00687D6E /* NumberUtil.m in Sources */,
B660F7871C29988E00687D6E /* StringUtil.m in Sources */,
45FBC5C91DF8575700E9B410 /* CallKitCallManager.swift in Sources */,
B660F78A1C29988E00687D6E /* UIUtil.m in Sources */,
B660F78C1C29988E00687D6E /* UIDevice+TSHardwareVersion.m in Sources */,
@ -3565,7 +3573,7 @@
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
@ -3640,8 +3648,8 @@
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
@ -3718,7 +3726,7 @@
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";

View File

@ -147,7 +147,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
[UIUtil applySignalAppearence];
if (getenv("runningTests_dontStartApp")) {
if (CurrentAppContext().isRunningTests) {
return YES;
}
@ -178,11 +178,11 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(databaseViewRegistrationComplete)
name:kNSNotificationName_DatabaseViewRegistrationComplete
name:DatabaseViewRegistrationCompleteNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(registrationStateDidChange)
name:kNSNotificationName_RegistrationStateDidChange
name:RegistrationStateDidChangeNotification
object:nil];
DDLogInfo(@"%@ application: didFinishLaunchingWithOptions completed.", self.logTag);
@ -288,7 +288,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
{
[Environment setCurrent:[Release releaseEnvironment]];
// Encryption/Descryption mutates session state and must be synchronized on a serial queue.
// Encryption/Decryption mutates session state and must be synchronized on a serial queue.
[SessionCipher setSessionCipherDispatchQueue:[OWSDispatch sessionStoreQueue]];
TextSecureKitEnv *sharedEnv =
@ -503,7 +503,7 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
- (void)applicationDidBecomeActive:(UIApplication *)application {
DDLogWarn(@"%@ applicationDidBecomeActive.", self.logTag);
if (getenv("runningTests_dontStartApp")) {
if (CurrentAppContext().isRunningTests) {
return;
}

View File

@ -9,8 +9,6 @@ import SignalServiceKit
@objc(OWSMessageFetcherJob)
class MessageFetcherJob: NSObject {
private let TAG = "[MessageFetcherJob]"
private var timer: Timer?
// MARK: injected dependencies
@ -25,25 +23,25 @@ class MessageFetcherJob: NSObject {
}
public func run() -> Promise<Void> {
Logger.debug("\(TAG) in \(#function)")
Logger.debug("\(self.logTag) in \(#function)")
guard signalService.isCensorshipCircumventionActive else {
Logger.debug("\(self.TAG) delegating message fetching to SocketManager since we're using normal transport.")
Logger.debug("\(self.logTag) delegating message fetching to SocketManager since we're using normal transport.")
TSSocketManager.requestSocketOpen()
return Promise(value: ())
}
Logger.info("\(TAG) fetching messages via REST.")
Logger.info("\(self.logTag) fetching messages via REST.")
let promise = self.fetchUndeliveredMessages().then { (envelopes: [OWSSignalServiceProtosEnvelope], more: Bool) -> Promise<Void> in
for envelope in envelopes {
Logger.info("\(self.TAG) received envelope.")
Logger.info("\(self.logTag) received envelope.")
self.messageReceiver.handleReceivedEnvelope(envelope)
self.acknowledgeDelivery(envelope: envelope)
}
if more {
Logger.info("\(self.TAG) fetching more messages.")
Logger.info("\(self.logTag) fetching more messages.")
return self.run()
} else {
// All finished
@ -63,7 +61,7 @@ class MessageFetcherJob: NSObject {
// use in DEBUG or wherever you can't receive push notifications to poll for messages.
// Do not use in production.
public func startRunLoop(timeInterval: Double) {
Logger.error("\(TAG) Starting message fetch polling. This should not be used in production.")
Logger.error("\(self.logTag) Starting message fetch polling. This should not be used in production.")
timer = WeakTimer.scheduledTimer(timeInterval: timeInterval, target: self, userInfo: nil, repeats: true) {[weak self] _ in
let _: Promise<Void>? = self?.run()
return
@ -77,17 +75,17 @@ class MessageFetcherJob: NSObject {
private func parseMessagesResponse(responseObject: Any?) -> (envelopes: [OWSSignalServiceProtosEnvelope], more: Bool)? {
guard let responseObject = responseObject else {
Logger.error("\(self.TAG) response object was surpringly nil")
Logger.error("\(self.logTag) response object was surpringly nil")
return nil
}
guard let responseDict = responseObject as? [String: Any] else {
Logger.error("\(self.TAG) response object was not a dictionary")
Logger.error("\(self.logTag) response object was not a dictionary")
return nil
}
guard let messageDicts = responseDict["messages"] as? [[String: Any]] else {
Logger.error("\(self.TAG) messages object was not a list of dictionaries")
Logger.error("\(self.logTag) messages object was not a list of dictionaries")
return nil
}
@ -95,7 +93,7 @@ class MessageFetcherJob: NSObject {
if let responseMore = responseDict["more"] as? Bool {
return responseMore
} else {
Logger.warn("\(self.TAG) more object was not a bool. Assuming no more")
Logger.warn("\(self.logTag) more object was not a bool. Assuming no more")
return false
}
}()
@ -112,12 +110,12 @@ class MessageFetcherJob: NSObject {
let builder = OWSSignalServiceProtosEnvelopeBuilder()
guard let typeInt = messageDict["type"] as? Int32 else {
Logger.error("\(TAG) message body didn't have type")
Logger.error("\(self.logTag) message body didn't have type")
return nil
}
guard let type = OWSSignalServiceProtosEnvelopeType(rawValue:typeInt) else {
Logger.error("\(TAG) message body type was invalid")
Logger.error("\(self.logTag) message body type was invalid")
return nil
}
builder.setType(type)
@ -127,32 +125,32 @@ class MessageFetcherJob: NSObject {
}
guard let timestamp = messageDict["timestamp"] as? UInt64 else {
Logger.error("\(TAG) message body didn't have timestamp")
Logger.error("\(self.logTag) message body didn't have timestamp")
return nil
}
builder.setTimestamp(timestamp)
guard let source = messageDict["source"] as? String else {
Logger.error("\(TAG) message body didn't have source")
Logger.error("\(self.logTag) message body didn't have source")
return nil
}
builder.setSource(source)
guard let sourceDevice = messageDict["sourceDevice"] as? UInt32 else {
Logger.error("\(TAG) message body didn't have sourceDevice")
Logger.error("\(self.logTag) message body didn't have sourceDevice")
return nil
}
builder.setSourceDevice(sourceDevice)
if let encodedLegacyMessage = messageDict["message"] as? String {
Logger.debug("\(TAG) message body had legacyMessage")
Logger.debug("\(self.logTag) message body had legacyMessage")
if let legacyMessage = Data(base64Encoded: encodedLegacyMessage) {
builder.setLegacyMessage(legacyMessage)
}
}
if let encodedContent = messageDict["content"] as? String {
Logger.debug("\(TAG) message body had content")
Logger.debug("\(self.logTag) message body had content")
if let content = Data(base64Encoded: encodedContent) {
builder.setContent(content)
}
@ -169,7 +167,7 @@ class MessageFetcherJob: NSObject {
messagesRequest,
success: { (_: URLSessionDataTask?, responseObject: Any?) -> Void in
guard let (envelopes, more) = self.parseMessagesResponse(responseObject: responseObject) else {
Logger.error("\(self.TAG) response object had unexpected content")
Logger.error("\(self.logTag) response object had unexpected content")
return reject(OWSErrorMakeUnableToProcessServerResponseError())
}
@ -177,7 +175,7 @@ class MessageFetcherJob: NSObject {
},
failure: { (_: URLSessionDataTask?, error: Error?) in
guard let error = error else {
Logger.error("\(self.TAG) error was surpringly nil. sheesh rough day.")
Logger.error("\(self.logTag) error was surpringly nil. sheesh rough day.")
return reject(OWSErrorMakeUnableToProcessServerResponseError())
}
@ -190,10 +188,10 @@ class MessageFetcherJob: NSObject {
let request = OWSAcknowledgeMessageDeliveryRequest(source: envelope.source, timestamp: envelope.timestamp)
self.networkManager.makeRequest(request,
success: { (_: URLSessionDataTask?, _: Any?) -> Void in
Logger.debug("\(self.TAG) acknowledged delivery for message at timestamp: \(envelope.timestamp)")
Logger.debug("\(self.logTag) acknowledged delivery for message at timestamp: \(envelope.timestamp)")
},
failure: { (_: URLSessionDataTask?, error: Error?) in
Logger.debug("\(self.TAG) acknowledging delivery for message at timestamp: \(envelope.timestamp) failed with error: \(String(describing: error))")
Logger.debug("\(self.logTag) acknowledging delivery for message at timestamp: \(envelope.timestamp) failed with error: \(String(describing: error))")
})
}
}

View File

@ -5,7 +5,6 @@
#import "CodeVerificationViewController.h"
#import "ProfileViewController.h"
#import "Signal-Swift.h"
#import "StringUtil.h"
#import "UIViewController+OWS.h"
#import <PromiseKit/AnyPromise.h>
#import <SignalServiceKit/OWSError.h>

View File

@ -19,7 +19,6 @@
#import "TSGroupThread.h"
#import "TSStorageManager.h"
#import "UIUtil.h"
#import "VersionMigrations.h"
#import "ViewControllerUtils.h"
#import <PromiseKit/AnyPromise.h>
#import <SignalMessaging/OWSFormat.h>

View File

@ -5,7 +5,6 @@
#import "InboxTableViewCell.h"
#import "OWSAvatarBuilder.h"
#import "Signal-Swift.h"
#import "Util.h"
#import "ViewControllerUtils.h"
#import <SignalMessaging/OWSFormat.h>
#import <SignalServiceKit/OWSMessageManager.h>

View File

@ -1,98 +0,0 @@
//
// LockInteractionController.m
// Signal
//
// Created by Frederic Jacobs on 22/08/15.
// Copyright (c) 2015 Open Whisper Systems. All rights reserved.
//
#import "LockInteractionController.h"
@interface LockInteractionController ()
@property UIAlertController *alertController;
@end
@implementation LockInteractionController
+ (instancetype)sharedController {
static LockInteractionController *sharedController = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedController = [self new];
});
return sharedController;
}
+ (void)performBlock:(LIControllerBlockingOperation)blockingOperation
completionBlock:(LIControllerCompletionBlock)completionBlock
retryBlock:(LIControllerRetryBlock)retryBlock
usesNetwork:(BOOL)networkFlag
{
if (networkFlag) {
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:networkFlag];
}
LockInteractionController *sharedController = [LockInteractionController sharedController];
sharedController.alertController =
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"Upgrading Signal ...", nil)
message:nil
preferredStyle:UIAlertControllerStyleAlert];
[[UIApplication sharedApplication]
.keyWindow.rootViewController presentViewController:sharedController.alertController
animated:YES
completion:nil];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
BOOL success = blockingOperation();
dispatch_async(dispatch_get_main_queue(), ^{
[sharedController.alertController
dismissViewControllerAnimated:YES
completion:^{
if (networkFlag) {
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
}
if (!success) {
retryBlock(blockingOperation, completionBlock);
} else {
completionBlock();
}
}];
});
});
}
+ (LIControllerRetryBlock)defaultNetworkRetry {
LIControllerRetryBlock retryBlock =
^void(LIControllerBlockingOperation blockingOperation, LIControllerCompletionBlock completionBlock) {
UIAlertController *retryController =
[UIAlertController alertControllerWithTitle:@"Upgrading Signal failed"
message:@"An network error occured while upgrading, please check "
@"your connectivity and try again."
preferredStyle:UIAlertControllerStyleAlert];
[retryController
addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"REGISTER_FAILED_TRY_AGAIN", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
[self performBlock:blockingOperation
completionBlock:completionBlock
retryBlock:[LockInteractionController defaultNetworkRetry]
usesNetwork:YES];
}]];
[[UIApplication sharedApplication]
.keyWindow.rootViewController presentViewController:retryController
animated:YES
completion:nil];
};
return retryBlock;
}
@end

View File

@ -11,7 +11,6 @@
#import "OWSTableViewController.h"
#import "PhoneNumber.h"
#import "Signal-Swift.h"
#import "StringUtil.h"
#import "UIFont+OWS.h"
#import "UIUtil.h"
#import "UIView+OWS.h"

View File

@ -7,7 +7,6 @@
#import "HomeViewController.h"
#import "PhoneNumber.h"
#import "Signal-Swift.h"
#import "StringUtil.h"
#import <AVFoundation/AVFoundation.h>
#import <SignalServiceKit/PhoneNumberUtil.h>

View File

@ -90,13 +90,11 @@ struct AudioSource: Hashable {
@objc class CallAudioService: NSObject, CallObserver {
private let TAG = "[CallAudioService]"
private var vibrateTimer: Timer?
private let audioPlayer = AVAudioPlayer()
private let handleRinging: Bool
class Sound {
let TAG = "[Sound]"
class Sound: NSObject {
static let incomingRing = Sound(filePath: "r", fileExtension: "caf", loop: true)
static let outgoingRing = Sound(filePath: "outring", fileExtension: "mp3", loop: true)
@ -125,7 +123,7 @@ struct AudioSource: Hashable {
newPlayer?.numberOfLoops = -1
}
} catch {
owsFail("\(self.TAG) failed to build audio player with error: \(error)")
owsFail("\(self.logTag) failed to build audio player with error: \(error)")
newPlayer = nil
}
return newPlayer
@ -233,7 +231,7 @@ struct AudioSource: Hashable {
// because some sources are only valid for certain category/option combinations.
let existingPreferredInput = session.preferredInput
if existingPreferredInput != call.audioSource?.portDescription {
Logger.info("\(TAG) changing preferred input: \(String(describing: existingPreferredInput)) -> \(String(describing: call.audioSource?.portDescription))")
Logger.info("\(self.logTag) changing preferred input: \(String(describing: existingPreferredInput)) -> \(String(describing: call.audioSource?.portDescription))")
try session.setPreferredInput(call.audioSource?.portDescription)
}
@ -241,21 +239,21 @@ struct AudioSource: Hashable {
// We want consistent ringer-volume between speaker-phone and video chat.
// But because using VideoChat mode has noticeably higher output gain, we treat
// video chat like speakerphone mode until the call is connected.
Logger.verbose("\(TAG) enabling speakerphone overrideOutputAudioPort(.speaker)")
Logger.verbose("\(self.logTag) enabling speakerphone overrideOutputAudioPort(.speaker)")
try session.overrideOutputAudioPort(.speaker)
} else {
Logger.verbose("\(TAG) disabling spearkerphone overrideOutputAudioPort(.none) ")
Logger.verbose("\(self.logTag) disabling spearkerphone overrideOutputAudioPort(.none) ")
try session.overrideOutputAudioPort(.none)
}
} catch {
owsFail("\(TAG) failed setting audio source with error: \(error) isSpeakerPhoneEnabled: \(call.isSpeakerphoneEnabled)")
owsFail("\(self.logTag) failed setting audio source with error: \(error) isSpeakerPhoneEnabled: \(call.isSpeakerphoneEnabled)")
}
}
// MARK: - Service action handlers
public func didUpdateVideoTracks(call: SignalCall?) {
Logger.verbose("\(TAG) in \(#function)")
Logger.verbose("\(self.logTag) in \(#function)")
self.ensureProperAudioSession(call: call)
}
@ -263,7 +261,7 @@ struct AudioSource: Hashable {
public func handleState(call: SignalCall) {
assert(Thread.isMainThread)
Logger.verbose("\(TAG) in \(#function) new state: \(call.state)")
Logger.verbose("\(self.logTag) in \(#function) new state: \(call.state)")
// Stop playing sounds while switching audio session so we don't
// get any blips across a temporary unintended route.
@ -285,11 +283,11 @@ struct AudioSource: Hashable {
}
private func handleIdle(call: SignalCall) {
Logger.debug("\(TAG) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
}
private func handleDialing(call: SignalCall) {
Logger.debug("\(TAG) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
AssertIsOnMainThread()
// HACK: Without this async, dialing sound only plays once. I don't really understand why. Does the audioSession
@ -300,45 +298,45 @@ struct AudioSource: Hashable {
}
private func handleAnswering(call: SignalCall) {
Logger.debug("\(TAG) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
AssertIsOnMainThread()
}
private func handleRemoteRinging(call: SignalCall) {
Logger.debug("\(TAG) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
AssertIsOnMainThread()
self.play(sound: Sound.outgoingRing)
}
private func handleLocalRinging(call: SignalCall) {
Logger.debug("\(TAG) in \(#function)")
Logger.debug("\(self.logTag) in \(#function)")
AssertIsOnMainThread()
startRinging(call: call)
}
private func handleConnected(call: SignalCall) {
Logger.debug("\(TAG) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
AssertIsOnMainThread()
}
private func handleLocalFailure(call: SignalCall) {
Logger.debug("\(TAG) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
AssertIsOnMainThread()
play(sound: Sound.failure)
}
private func handleLocalHangup(call: SignalCall) {
Logger.debug("\(TAG) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
AssertIsOnMainThread()
handleCallEnded(call: call)
}
private func handleRemoteHangup(call: SignalCall) {
Logger.debug("\(TAG) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
AssertIsOnMainThread()
vibrate()
@ -347,7 +345,7 @@ struct AudioSource: Hashable {
}
private func handleBusy(call: SignalCall) {
Logger.debug("\(TAG) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
AssertIsOnMainThread()
play(sound: Sound.busy)
@ -359,7 +357,7 @@ struct AudioSource: Hashable {
}
private func handleCallEnded(call: SignalCall) {
Logger.debug("\(TAG) \(#function)")
Logger.debug("\(self.logTag) \(#function)")
AssertIsOnMainThread()
// Stop solo audio, revert to default.
@ -377,10 +375,10 @@ struct AudioSource: Hashable {
private func play(sound: Sound) {
guard let newPlayer = sound.player else {
owsFail("\(self.TAG) unable to build player")
owsFail("\(self.logTag) unable to build player")
return
}
Logger.info("\(self.TAG) playing sound: \(sound.filePath)")
Logger.info("\(self.logTag) playing sound: \(sound.filePath)")
// It's important to stop the current player **before** starting the new player. In the case that
// we're playing the same sound, since the player is memoized on the sound instance, we'd otherwise
@ -394,7 +392,7 @@ struct AudioSource: Hashable {
private func startRinging(call: SignalCall) {
guard handleRinging else {
Logger.debug("\(TAG) ignoring \(#function) since CallKit handles it's own ringing state")
Logger.debug("\(self.logTag) ignoring \(#function) since CallKit handles it's own ringing state")
return
}
@ -407,10 +405,10 @@ struct AudioSource: Hashable {
private func stopAnyRingingVibration() {
guard handleRinging else {
Logger.debug("\(TAG) ignoring \(#function) since CallKit handles it's own ringing state")
Logger.debug("\(self.logTag) ignoring \(#function) since CallKit handles it's own ringing state")
return
}
Logger.debug("\(TAG) in \(#function)")
Logger.debug("\(self.logTag) in \(#function)")
// Stop vibrating
vibrateTimer?.invalidate()
@ -453,7 +451,7 @@ struct AudioSource: Hashable {
return [AudioSource.builtInSpeaker]
}
Logger.info("\(TAG) in \(#function) availableInputs: \(availableInputs)")
Logger.info("\(self.logTag) in \(#function) availableInputs: \(availableInputs)")
return [AudioSource.builtInSpeaker] + availableInputs.map { portDescription in
return AudioSource(portDescription: portDescription)
}
@ -497,13 +495,13 @@ struct AudioSource: Hashable {
audioSessionChanged = true
if oldCategory != category {
Logger.debug("\(self.TAG) audio session changed category: \(oldCategory) -> \(category) ")
Logger.debug("\(self.logTag) audio session changed category: \(oldCategory) -> \(category) ")
}
if oldMode != mode {
Logger.debug("\(self.TAG) audio session changed mode: \(oldMode) -> \(mode) ")
Logger.debug("\(self.logTag) audio session changed mode: \(oldMode) -> \(mode) ")
}
if oldOptions != options {
Logger.debug("\(self.TAG) audio session changed options: \(oldOptions) -> \(options) ")
Logger.debug("\(self.logTag) audio session changed options: \(oldOptions) -> \(options) ")
}
try session.setCategory(category, mode: mode, options: options)
@ -518,21 +516,21 @@ struct AudioSource: Hashable {
audioSessionChanged = true
if oldCategory != category {
Logger.debug("\(self.TAG) audio session changed category: \(oldCategory) -> \(category) ")
Logger.debug("\(self.logTag) audio session changed category: \(oldCategory) -> \(category) ")
}
if oldOptions != options {
Logger.debug("\(self.TAG) audio session changed options: \(oldOptions) -> \(options) ")
Logger.debug("\(self.logTag) audio session changed options: \(oldOptions) -> \(options) ")
}
try session.setCategory(category, with: options)
}
} catch {
let message = "\(self.TAG) in \(#function) failed to set category: \(category) mode: \(String(describing: mode)), options: \(options) with error: \(error)"
let message = "\(self.logTag) in \(#function) failed to set category: \(category) mode: \(String(describing: mode)), options: \(options) with error: \(error)"
owsFail(message)
}
if audioSessionChanged {
Logger.info("\(TAG) in \(#function)")
Logger.info("\(self.logTag) in \(#function)")
// Update call view synchronously; already on main thread.
NotificationCenter.default.post(name:CallAudioServiceSessionChanged, object: nil)
}

View File

@ -103,8 +103,6 @@ protocol CallServiceObserver: class {
// MARK: - Properties
let TAG = "[CallService]"
var observers = [Weak<CallServiceObserver>]()
// MARK: Dependencies
@ -128,7 +126,7 @@ protocol CallServiceObserver: class {
didSet {
AssertIsOnMainThread()
Logger.debug("\(self.TAG) .peerConnectionClient setter: \(oldValue != nil) -> \(peerConnectionClient != nil) \(String(describing: peerConnectionClient))")
Logger.debug("\(self.logTag) .peerConnectionClient setter: \(oldValue != nil) -> \(peerConnectionClient != nil) \(String(describing: peerConnectionClient))")
}
}
@ -153,7 +151,7 @@ protocol CallServiceObserver: class {
}
}
Logger.debug("\(self.TAG) .call setter: \(oldValue?.identifiersForLogs as Optional) -> \(call?.identifiersForLogs as Optional)")
Logger.debug("\(self.logTag) .call setter: \(oldValue?.identifiersForLogs as Optional) -> \(call?.identifiersForLogs as Optional)")
for observer in observers {
observer.value?.didUpdateCall(call: call)
@ -192,7 +190,7 @@ protocol CallServiceObserver: class {
didSet {
AssertIsOnMainThread()
Logger.info("\(self.TAG) \(#function)")
Logger.info("\(self.logTag) \(#function)")
fireDidUpdateVideoTracks()
}
@ -202,7 +200,7 @@ protocol CallServiceObserver: class {
didSet {
AssertIsOnMainThread()
Logger.info("\(self.TAG) \(#function)")
Logger.info("\(self.logTag) \(#function)")
fireDidUpdateVideoTracks()
}
@ -211,7 +209,7 @@ protocol CallServiceObserver: class {
didSet {
AssertIsOnMainThread()
Logger.info("\(self.TAG) \(#function): \(isRemoteVideoEnabled)")
Logger.info("\(self.logTag) \(#function): \(isRemoteVideoEnabled)")
fireDidUpdateVideoTracks()
}
@ -259,7 +257,7 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
if self.call != nil {
Logger.warn("\(TAG) ending current call in \(#function). Did user toggle callkit preference while in a call?")
Logger.warn("\(self.logTag) ending current call in \(#function). Did user toggle callkit preference while in a call?")
self.terminateCall()
}
self.callUIAdapter = CallUIAdapter(callService: self, contactsManager: self.contactsManager, notificationsAdapter: self.notificationsAdapter)
@ -274,7 +272,7 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
guard self.call == nil else {
let errorDescription = "\(TAG) call was unexpectedly already set."
let errorDescription = "\(self.logTag) call was unexpectedly already set."
Logger.error(errorDescription)
call.state = .localFailure
OWSProdError(OWSAnalyticsEvents.callServiceCallAlreadySet(), file: #file, function: #function, line: #line)
@ -291,14 +289,14 @@ protocol CallServiceObserver: class {
call.callRecord = callRecord
let promise = getIceServers().then { iceServers -> Promise<HardenedRTCSessionDescription> in
Logger.debug("\(self.TAG) got ice servers:\(iceServers) for call: \(call.identifiersForLogs)")
Logger.debug("\(self.logTag) got ice servers:\(iceServers) for call: \(call.identifiersForLogs)")
guard self.call == call else {
throw CallError.obsoleteCall(description: "obsolete call in \(#function)")
}
guard self.peerConnectionClient == nil else {
let errorDescription = "\(self.TAG) peerconnection was unexpectedly already set."
let errorDescription = "\(self.logTag) peerconnection was unexpectedly already set."
Logger.error(errorDescription)
OWSProdError(OWSAnalyticsEvents.callServicePeerConnectionAlreadySet(), file: #file, function: #function, line: #line)
throw CallError.assertionError(description: errorDescription)
@ -307,7 +305,7 @@ protocol CallServiceObserver: class {
let useTurnOnly = Environment.current().preferences.doCallsHideIPAddress()
let peerConnectionClient = PeerConnectionClient(iceServers: iceServers, delegate: self, callDirection: .outgoing, useTurnOnly: useTurnOnly)
Logger.debug("\(self.TAG) setting peerConnectionClient in \(#function) for call: \(call.identifiersForLogs)")
Logger.debug("\(self.logTag) setting peerConnectionClient in \(#function) for call: \(call.identifiersForLogs)")
self.peerConnectionClient = peerConnectionClient
self.fulfillPeerConnectionClientPromise?()
@ -349,10 +347,10 @@ protocol CallServiceObserver: class {
return race(timeout, callConnectedPromise)
}.then {
Logger.info(self.call == call
? "\(self.TAG) outgoing call connected: \(call.identifiersForLogs)."
: "\(self.TAG) obsolete outgoing call connected: \(call.identifiersForLogs).")
? "\(self.logTag) outgoing call connected: \(call.identifiersForLogs)."
: "\(self.logTag) obsolete outgoing call connected: \(call.identifiersForLogs).")
}.catch { error in
Logger.error("\(self.TAG) placing call \(call.identifiersForLogs) failed with error: \(error)")
Logger.error("\(self.logTag) placing call \(call.identifiersForLogs) failed with error: \(error)")
if let callError = error as? CallError {
OWSProdInfo(OWSAnalyticsEvents.callServiceErrorOutgoingConnectionFailedInternal(), file: #file, function: #function, line: #line)
@ -392,16 +390,16 @@ protocol CallServiceObserver: class {
* Called by the call initiator after receiving a CallAnswer from the callee.
*/
public func handleReceivedAnswer(thread: TSContactThread, callId: UInt64, sessionDescription: String) {
Logger.info("\(TAG) received call answer for call: \(callId) thread: \(thread.contactIdentifier())")
Logger.info("\(self.logTag) received call answer for call: \(callId) thread: \(thread.contactIdentifier())")
AssertIsOnMainThread()
guard let call = self.call else {
Logger.warn("\(self.TAG) ignoring obsolete call: \(callId) in \(#function)")
Logger.warn("\(self.logTag) ignoring obsolete call: \(callId) in \(#function)")
return
}
guard call.signalingId == callId else {
Logger.warn("\(self.TAG) ignoring mismatched call: \(callId) currentCall: \(call.signalingId) in \(#function)")
Logger.warn("\(self.logTag) ignoring mismatched call: \(callId) currentCall: \(call.signalingId) in \(#function)")
return
}
@ -409,11 +407,11 @@ protocol CallServiceObserver: class {
self.sendIceUpdatesImmediately = true
if pendingIceUpdateMessages.count > 0 {
Logger.error("\(self.TAG) Sending \(pendingIceUpdateMessages.count) pendingIceUpdateMessages")
Logger.error("\(self.logTag) Sending \(pendingIceUpdateMessages.count) pendingIceUpdateMessages")
let callMessage = OWSOutgoingCallMessage(thread: thread, iceUpdateMessages: pendingIceUpdateMessages)
let sendPromise = messageSender.sendPromise(message: callMessage).catch { error in
Logger.error("\(self.TAG) failed to send ice updates in \(#function) with error: \(error)")
Logger.error("\(self.logTag) failed to send ice updates in \(#function) with error: \(error)")
}
sendPromise.retainUntilComplete()
}
@ -426,7 +424,7 @@ protocol CallServiceObserver: class {
let sessionDescription = RTCSessionDescription(type: .answer, sdp: sessionDescription)
let setDescriptionPromise = peerConnectionClient.setRemoteSessionDescription(sessionDescription).then {
Logger.debug("\(self.TAG) successfully set remote description")
Logger.debug("\(self.logTag) successfully set remote description")
}.catch { error in
if let callError = error as? CallError {
OWSProdInfo(OWSAnalyticsEvents.callServiceErrorHandleReceivedErrorInternal(), file: #file, function: #function, line: #line)
@ -468,7 +466,7 @@ protocol CallServiceObserver: class {
* Received a call while already in another call.
*/
private func handleLocalBusyCall(_ call: SignalCall) {
Logger.info("\(TAG) \(#function) for call: \(call.identifiersForLogs) thread: \(call.thread.contactIdentifier())")
Logger.info("\(self.logTag) \(#function) for call: \(call.identifiersForLogs) thread: \(call.thread.contactIdentifier())")
AssertIsOnMainThread()
let busyMessage = OWSCallBusyMessage(callId: call.signalingId)
@ -483,21 +481,21 @@ protocol CallServiceObserver: class {
* The callee was already in another call.
*/
public func handleRemoteBusy(thread: TSContactThread, callId: UInt64) {
Logger.info("\(TAG) \(#function) for thread: \(thread.contactIdentifier())")
Logger.info("\(self.logTag) \(#function) for thread: \(thread.contactIdentifier())")
AssertIsOnMainThread()
guard let call = self.call else {
Logger.warn("\(self.TAG) ignoring obsolete call: \(callId) in \(#function)")
Logger.warn("\(self.logTag) ignoring obsolete call: \(callId) in \(#function)")
return
}
guard call.signalingId == callId else {
Logger.warn("\(self.TAG) ignoring mismatched call: \(callId) currentCall: \(call.signalingId) in \(#function)")
Logger.warn("\(self.logTag) ignoring mismatched call: \(callId) currentCall: \(call.signalingId) in \(#function)")
return
}
guard thread.contactIdentifier() == call.remotePhoneNumber else {
Logger.warn("\(self.TAG) ignoring obsolete call in \(#function)")
Logger.warn("\(self.logTag) ignoring obsolete call in \(#function)")
return
}
@ -515,18 +513,18 @@ protocol CallServiceObserver: class {
let newCall = SignalCall.incomingCall(localId: UUID(), remotePhoneNumber: thread.contactIdentifier(), signalingId: callId)
Logger.info("\(TAG) receivedCallOffer: \(newCall.identifiersForLogs)")
Logger.info("\(self.logTag) receivedCallOffer: \(newCall.identifiersForLogs)")
let untrustedIdentity = OWSIdentityManager.shared().untrustedIdentityForSending(toRecipientId: thread.contactIdentifier())
guard untrustedIdentity == nil else {
Logger.warn("\(TAG) missed a call due to untrusted identity: \(newCall.identifiersForLogs)")
Logger.warn("\(self.logTag) missed a call due to untrusted identity: \(newCall.identifiersForLogs)")
let callerName = self.contactsManager.displayName(forPhoneIdentifier: thread.contactIdentifier())
switch untrustedIdentity!.verificationState {
case .verified:
owsFail("\(TAG) shouldn't have missed a call due to untrusted identity if the identity is verified")
owsFail("\(self.logTag) shouldn't have missed a call due to untrusted identity if the identity is verified")
self.notificationsAdapter.presentMissedCall(newCall, callerName: callerName)
case .default:
self.notificationsAdapter.presentMissedCallBecauseOfNewIdentity(call: newCall, callerName: callerName)
@ -551,12 +549,12 @@ protocol CallServiceObserver: class {
let existingCall = self.call!
// TODO on iOS10+ we can use CallKit to swap calls rather than just returning busy immediately.
Logger.info("\(TAG) receivedCallOffer: \(newCall.identifiersForLogs) but we're already in call: \(existingCall.identifiersForLogs)")
Logger.info("\(self.logTag) receivedCallOffer: \(newCall.identifiersForLogs) but we're already in call: \(existingCall.identifiersForLogs)")
handleLocalBusyCall(newCall)
if existingCall.remotePhoneNumber == newCall.remotePhoneNumber {
Logger.info("\(TAG) handling call from current call user as remote busy.: \(newCall.identifiersForLogs) but we're already in call: \(existingCall.identifiersForLogs)")
Logger.info("\(self.logTag) handling call from current call user as remote busy.: \(newCall.identifiersForLogs) but we're already in call: \(existingCall.identifiersForLogs)")
// If we're receiving a new call offer from the user we already think we have a call with,
// terminate our current call to get back to a known good state. If they call back, we'll
@ -580,7 +578,7 @@ protocol CallServiceObserver: class {
return
}
Logger.info("\(TAG) starting new call: \(newCall.identifiersForLogs)")
Logger.info("\(self.logTag) starting new call: \(newCall.identifiersForLogs)")
self.call = newCall
@ -588,7 +586,7 @@ protocol CallServiceObserver: class {
let timeout = CallError.timeout(description: "background task time ran out before call connected.")
DispatchQueue.main.async {
guard self.call == newCall else {
Logger.warn("\(self.TAG) ignoring obsolete call in \(#function)")
Logger.warn("\(self.logTag) ignoring obsolete call in \(#function)")
return
}
self.handleFailedCall(failedCall: newCall, error: timeout)
@ -611,7 +609,7 @@ protocol CallServiceObserver: class {
let useTurnOnly = unknownCaller || Environment.current().preferences.doCallsHideIPAddress()
Logger.debug("\(self.TAG) setting peerConnectionClient in \(#function) for: \(newCall.identifiersForLogs)")
Logger.debug("\(self.logTag) setting peerConnectionClient in \(#function) for: \(newCall.identifiersForLogs)")
let peerConnectionClient = PeerConnectionClient(iceServers: iceServers, delegate: self, callDirection: .incoming, useTurnOnly: useTurnOnly)
self.peerConnectionClient = peerConnectionClient
self.fulfillPeerConnectionClientPromise?()
@ -622,7 +620,7 @@ protocol CallServiceObserver: class {
// Find a sessionDescription compatible with my constraints and the remote sessionDescription
return peerConnectionClient.negotiateSessionDescription(remoteDescription: offerSessionDescription, constraints: constraints)
}.then { (negotiatedSessionDescription: HardenedRTCSessionDescription) in
Logger.debug("\(self.TAG) set the remote description for: \(newCall.identifiersForLogs)")
Logger.debug("\(self.logTag) set the remote description for: \(newCall.identifiersForLogs)")
guard self.call == newCall else {
throw CallError.obsoleteCall(description: "negotiateSessionDescription() response for obsolete call")
@ -636,7 +634,7 @@ protocol CallServiceObserver: class {
guard self.call == newCall else {
throw CallError.obsoleteCall(description: "sendPromise(message: ) response for obsolete call")
}
Logger.debug("\(self.TAG) successfully sent callAnswerMessage for: \(newCall.identifiersForLogs)")
Logger.debug("\(self.logTag) successfully sent callAnswerMessage for: \(newCall.identifiersForLogs)")
// There's nothing technically forbidding receiving ICE updates before receiving the CallAnswer, but this
// a more intuitive ordering.
@ -657,11 +655,11 @@ protocol CallServiceObserver: class {
return race(promise, timeout)
}.then {
Logger.info(self.call == newCall
? "\(self.TAG) incoming call connected: \(newCall.identifiersForLogs)."
: "\(self.TAG) obsolete incoming call connected: \(newCall.identifiersForLogs).")
? "\(self.logTag) incoming call connected: \(newCall.identifiersForLogs)."
: "\(self.logTag) obsolete incoming call connected: \(newCall.identifiersForLogs).")
}.catch { error in
guard self.call == newCall else {
Logger.debug("\(self.TAG) ignoring error: \(error) for obsolete call: \(newCall.identifiersForLogs).")
Logger.debug("\(self.logTag) ignoring error: \(error) for obsolete call: \(newCall.identifiersForLogs).")
return
}
if let callError = error as? CallError {
@ -673,7 +671,7 @@ protocol CallServiceObserver: class {
self.handleFailedCall(failedCall: newCall, error: externalError)
}
}.always {
Logger.debug("\(self.TAG) ending background task awaiting inbound call connection")
Logger.debug("\(self.logTag) ending background task awaiting inbound call connection")
UIApplication.shared.endBackgroundTask(backgroundTask)
}
incomingCallPromise.retainUntilComplete()
@ -692,7 +690,7 @@ protocol CallServiceObserver: class {
}
guard call.signalingId == callId else {
Logger.warn("\(self.TAG) ignoring mismatched call: \(callId) currentCall: \(call.signalingId) in \(#function)")
Logger.warn("\(self.logTag) ignoring mismatched call: \(callId) currentCall: \(call.signalingId) in \(#function)")
return
}
@ -709,7 +707,7 @@ protocol CallServiceObserver: class {
peerConnectionClient.addRemoteIceCandidate(RTCIceCandidate(sdp: sdp, sdpMLineIndex: lineIndex, sdpMid: mid))
}.catch { error in
OWSProdInfo(OWSAnalyticsEvents.callServiceErrorHandleRemoteAddedIceCandidate(), file: #file, function: #function, line: #line)
Logger.error("\(self.TAG) in \(#function) waitForPeerConnectionClient failed with error: \(error)")
Logger.error("\(self.logTag) in \(#function) waitForPeerConnectionClient failed with error: \(error)")
}.retainUntilComplete()
}
@ -745,7 +743,7 @@ protocol CallServiceObserver: class {
let iceUpdateMessage = OWSCallIceUpdateMessage(callId: call.signalingId, sdp: iceCandidate.sdp, sdpMLineIndex: iceCandidate.sdpMLineIndex, sdpMid: iceCandidate.sdpMid)
if self.sendIceUpdatesImmediately {
Logger.info("\(self.TAG) in \(#function). Sending immediately.")
Logger.info("\(self.logTag) in \(#function). Sending immediately.")
let callMessage = OWSOutgoingCallMessage(thread: call.thread, iceUpdateMessage: iceUpdateMessage)
let sendPromise = self.messageSender.sendPromise(message: callMessage)
sendPromise.retainUntilComplete()
@ -753,13 +751,13 @@ protocol CallServiceObserver: class {
// For outgoing messages, we wait to send ice updates until we're sure client received our call message.
// e.g. if the client has blocked our message due to an identity change, we'd otherwise
// bombard them with a bunch *more* undecipherable messages.
Logger.info("\(self.TAG) in \(#function). Enqueing for later.")
Logger.info("\(self.logTag) in \(#function). Enqueing for later.")
self.pendingIceUpdateMessages.append(iceUpdateMessage)
return
}
}.catch { error in
OWSProdInfo(OWSAnalyticsEvents.callServiceErrorHandleLocalAddedIceCandidate(), file: #file, function: #function, line: #line)
Logger.error("\(self.TAG) in \(#function) waitUntilReadyToSendIceUpdates failed with error: \(error)")
Logger.error("\(self.logTag) in \(#function) waitUntilReadyToSendIceUpdates failed with error: \(error)")
}.retainUntilComplete()
}
@ -776,11 +774,11 @@ protocol CallServiceObserver: class {
// This will only be called for the current peerConnectionClient, so
// fail the current call.
OWSProdError(OWSAnalyticsEvents.callServiceCallMissing(), file: #file, function: #function, line: #line)
handleFailedCurrentCall(error: CallError.assertionError(description: "\(TAG) ignoring \(#function) since there is no current call."))
handleFailedCurrentCall(error: CallError.assertionError(description: "\(self.logTag) ignoring \(#function) since there is no current call."))
return
}
Logger.info("\(TAG) in \(#function): \(call.identifiersForLogs).")
Logger.info("\(self.logTag) in \(#function): \(call.identifiersForLogs).")
switch call.state {
case .dialing:
@ -789,11 +787,11 @@ protocol CallServiceObserver: class {
call.state = .localRinging
self.callUIAdapter.reportIncomingCall(call, thread: call.thread)
case .remoteRinging:
Logger.info("\(TAG) call already ringing. Ignoring \(#function): \(call.identifiersForLogs).")
Logger.info("\(self.logTag) call already ringing. Ignoring \(#function): \(call.identifiersForLogs).")
case .connected:
Logger.info("\(TAG) Call reconnected \(#function): \(call.identifiersForLogs).")
Logger.info("\(self.logTag) Call reconnected \(#function): \(call.identifiersForLogs).")
default:
Logger.debug("\(TAG) unexpected call state for \(#function): \(call.state): \(call.identifiersForLogs).")
Logger.debug("\(self.logTag) unexpected call state for \(#function): \(call.state): \(call.identifiersForLogs).")
}
}
@ -801,34 +799,34 @@ protocol CallServiceObserver: class {
* The remote client (caller or callee) ended the call.
*/
public func handleRemoteHangup(thread: TSContactThread, callId: UInt64) {
Logger.debug("\(TAG) in \(#function)")
Logger.debug("\(self.logTag) in \(#function)")
AssertIsOnMainThread()
guard let call = self.call else {
// This may happen if we hang up slightly before they hang up.
handleFailedCurrentCall(error: .obsoleteCall(description:"\(TAG) call was unexpectedly nil in \(#function)"))
handleFailedCurrentCall(error: .obsoleteCall(description:"\(self.logTag) call was unexpectedly nil in \(#function)"))
return
}
guard call.signalingId == callId else {
Logger.warn("\(self.TAG) ignoring mismatched call: \(callId) currentCall: \(call.signalingId) in \(#function)")
Logger.warn("\(self.logTag) ignoring mismatched call: \(callId) currentCall: \(call.signalingId) in \(#function)")
return
}
guard thread.contactIdentifier() == call.thread.contactIdentifier() else {
// This can safely be ignored.
// We don't want to fail the current call because an old call was slow to send us the hangup message.
Logger.warn("\(TAG) ignoring hangup for thread: \(thread.contactIdentifier()) which is not the current call: \(call.identifiersForLogs)")
Logger.warn("\(self.logTag) ignoring hangup for thread: \(thread.contactIdentifier()) which is not the current call: \(call.identifiersForLogs)")
return
}
Logger.info("\(TAG) in \(#function): \(call.identifiersForLogs).")
Logger.info("\(self.logTag) in \(#function): \(call.identifiersForLogs).")
switch call.state {
case .idle, .dialing, .answering, .localRinging, .localFailure, .remoteBusy, .remoteRinging:
handleMissedCall(call)
case .connected, .localHangup, .remoteHangup:
Logger.info("\(TAG) call is finished.")
Logger.info("\(self.logTag) call is finished.")
}
call.state = .remoteHangup
@ -849,17 +847,17 @@ protocol CallServiceObserver: class {
guard let call = self.call else {
// This should never happen; return to a known good state.
owsFail("\(TAG) call was unexpectedly nil in \(#function)")
owsFail("\(self.logTag) call was unexpectedly nil in \(#function)")
OWSProdError(OWSAnalyticsEvents.callServiceCallMissing(), file: #file, function: #function, line: #line)
handleFailedCurrentCall(error: CallError.assertionError(description: "\(TAG) call was unexpectedly nil in \(#function)"))
handleFailedCurrentCall(error: CallError.assertionError(description: "\(self.logTag) call was unexpectedly nil in \(#function)"))
return
}
guard call.localId == localId else {
// This should never happen; return to a known good state.
owsFail("\(TAG) callLocalId:\(localId) doesn't match current calls: \(call.localId)")
owsFail("\(self.logTag) callLocalId:\(localId) doesn't match current calls: \(call.localId)")
OWSProdError(OWSAnalyticsEvents.callServiceCallIdMismatch(), file: #file, function: #function, line: #line)
handleFailedCurrentCall(error: CallError.assertionError(description: "\(TAG) callLocalId:\(localId) doesn't match current calls: \(call.localId)"))
handleFailedCurrentCall(error: CallError.assertionError(description: "\(self.logTag) callLocalId:\(localId) doesn't match current calls: \(call.localId)"))
return
}
@ -872,28 +870,28 @@ protocol CallServiceObserver: class {
public func handleAnswerCall(_ call: SignalCall) {
AssertIsOnMainThread()
Logger.debug("\(TAG) in \(#function)")
Logger.debug("\(self.logTag) in \(#function)")
guard let currentCall = self.call else {
OWSProdError(OWSAnalyticsEvents.callServiceCallMissing(), file: #file, function: #function, line: #line)
handleFailedCall(failedCall: call, error: CallError.assertionError(description: "\(TAG) ignoring \(#function) since there is no current call"))
handleFailedCall(failedCall: call, error: CallError.assertionError(description: "\(self.logTag) ignoring \(#function) since there is no current call"))
return
}
guard call == currentCall else {
// This could conceivably happen if the other party of an old call was slow to send us their answer
// and we've subsequently engaged in another call. Don't kill the current call, but just ignore it.
Logger.warn("\(TAG) ignoring \(#function) for call other than current call")
Logger.warn("\(self.logTag) ignoring \(#function) for call other than current call")
return
}
guard let peerConnectionClient = self.peerConnectionClient else {
OWSProdError(OWSAnalyticsEvents.callServicePeerConnectionMissing(), file: #file, function: #function, line: #line)
handleFailedCall(failedCall: call, error: CallError.assertionError(description: "\(TAG) missing peerconnection client in \(#function)"))
handleFailedCall(failedCall: call, error: CallError.assertionError(description: "\(self.logTag) missing peerconnection client in \(#function)"))
return
}
Logger.info("\(TAG) in \(#function): \(call.identifiersForLogs).")
Logger.info("\(self.logTag) in \(#function): \(call.identifiersForLogs).")
let callRecord = TSCall(timestamp: NSDate.ows_millisecondTimeStamp(), withCallNumber: call.remotePhoneNumber, callType: RPRecentCallTypeIncomingIncomplete, in: call.thread)
callRecord.save()
@ -910,16 +908,16 @@ protocol CallServiceObserver: class {
* For incoming call, when the local user has chosen to accept the call.
*/
func handleConnectedCall(_ call: SignalCall) {
Logger.info("\(TAG) in \(#function)")
Logger.info("\(self.logTag) in \(#function)")
AssertIsOnMainThread()
guard let peerConnectionClient = self.peerConnectionClient else {
OWSProdError(OWSAnalyticsEvents.callServicePeerConnectionMissing(), file: #file, function: #function, line: #line)
handleFailedCall(failedCall: call, error: CallError.assertionError(description: "\(TAG) peerConnectionClient unexpectedly nil in \(#function)"))
handleFailedCall(failedCall: call, error: CallError.assertionError(description: "\(self.logTag) peerConnectionClient unexpectedly nil in \(#function)"))
return
}
Logger.info("\(TAG) handleConnectedCall: \(call.identifiersForLogs).")
Logger.info("\(self.logTag) handleConnectedCall: \(call.identifiersForLogs).")
assert(self.fulfillCallConnectedPromise != nil)
// cancel connection timeout
@ -944,17 +942,17 @@ protocol CallServiceObserver: class {
guard let call = self.call else {
// This should never happen; return to a known good state.
owsFail("\(TAG) call was unexpectedly nil in \(#function)")
owsFail("\(self.logTag) call was unexpectedly nil in \(#function)")
OWSProdError(OWSAnalyticsEvents.callServiceCallMissing(), file: #file, function: #function, line: #line)
handleFailedCurrentCall(error: CallError.assertionError(description: "\(TAG) call was unexpectedly nil in \(#function)"))
handleFailedCurrentCall(error: CallError.assertionError(description: "\(self.logTag) call was unexpectedly nil in \(#function)"))
return
}
guard call.localId == localId else {
// This should never happen; return to a known good state.
owsFail("\(TAG) callLocalId:\(localId) doesn't match current calls: \(call.localId)")
owsFail("\(self.logTag) callLocalId:\(localId) doesn't match current calls: \(call.localId)")
OWSProdError(OWSAnalyticsEvents.callServiceCallIdMismatch(), file: #file, function: #function, line: #line)
handleFailedCurrentCall(error: CallError.assertionError(description: "\(TAG) callLocalId:\(localId) doesn't match current calls: \(call.localId)"))
handleFailedCurrentCall(error: CallError.assertionError(description: "\(self.logTag) callLocalId:\(localId) doesn't match current calls: \(call.localId)"))
return
}
@ -969,7 +967,7 @@ protocol CallServiceObserver: class {
public func handleDeclineCall(_ call: SignalCall) {
AssertIsOnMainThread()
Logger.info("\(TAG) in \(#function): \(call.identifiersForLogs).")
Logger.info("\(self.logTag) in \(#function): \(call.identifiersForLogs).")
if let callRecord = call.callRecord {
owsFail("Not expecting callrecord to already be set")
@ -993,7 +991,7 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
guard let currentCall = self.call else {
Logger.info("\(TAG) in \(#function), but no current call. Other party hung up just before us.")
Logger.info("\(self.logTag) in \(#function), but no current call. Other party hung up just before us.")
// terminating the call might be redundant, but it shouldn't hurt.
terminateCall()
@ -1002,11 +1000,11 @@ protocol CallServiceObserver: class {
guard call == currentCall else {
OWSProdError(OWSAnalyticsEvents.callServiceCallMismatch(), file: #file, function: #function, line: #line)
handleFailedCall(failedCall: call, error: CallError.assertionError(description: "\(TAG) ignoring \(#function) for call other than current call"))
handleFailedCall(failedCall: call, error: CallError.assertionError(description: "\(self.logTag) ignoring \(#function) for call other than current call"))
return
}
Logger.info("\(TAG) in \(#function): \(call.identifiersForLogs).")
Logger.info("\(self.logTag) in \(#function): \(call.identifiersForLogs).")
call.state = .localHangup
@ -1019,17 +1017,17 @@ protocol CallServiceObserver: class {
let message = DataChannelMessage.forHangup(callId: call.signalingId)
peerConnectionClient.sendDataChannelMessage(data: message.asData(), description: "hangup", isCritical: true)
} else {
Logger.info("\(TAG) ending call before peer connection created. Device offline or quick hangup.")
Logger.info("\(self.logTag) ending call before peer connection created. Device offline or quick hangup.")
}
// If the call hasn't started yet, we don't have a data channel to communicate the hang up. Use Signal Service Message.
let hangupMessage = OWSCallHangupMessage(callId: call.signalingId)
let callMessage = OWSOutgoingCallMessage(thread: call.thread, hangupMessage: hangupMessage)
let sendPromise = self.messageSender.sendPromise(message: callMessage).then {
Logger.debug("\(self.TAG) successfully sent hangup call message to \(call.thread.contactIdentifier())")
Logger.debug("\(self.logTag) successfully sent hangup call message to \(call.thread.contactIdentifier())")
}.catch { error in
OWSProdInfo(OWSAnalyticsEvents.callServiceErrorHandleLocalHungupCall(), file: #file, function: #function, line: #line)
Logger.error("\(self.TAG) failed to send hangup call message to \(call.thread.contactIdentifier()) with error: \(error)")
Logger.error("\(self.logTag) failed to send hangup call message to \(call.thread.contactIdentifier()) with error: \(error)")
}
sendPromise.retainUntilComplete()
@ -1046,7 +1044,7 @@ protocol CallServiceObserver: class {
guard call == self.call else {
// This can happen after a call has ended. Reproducible on iOS11, when the other party ends the call.
Logger.info("\(TAG) ignoring mute request for obsolete call")
Logger.info("\(self.logTag) ignoring mute request for obsolete call")
return
}
@ -1068,7 +1066,7 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
guard call == self.call else {
Logger.info("\(TAG) ignoring held request for obsolete call")
Logger.info("\(self.logTag) ignoring held request for obsolete call")
return
}
@ -1108,7 +1106,7 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
guard let frontmostViewController = UIApplication.shared.frontmostViewController else {
owsFail("\(TAG) could not identify frontmostViewController in \(#function)")
owsFail("\(self.logTag) could not identify frontmostViewController in \(#function)")
return
}
@ -1137,9 +1135,9 @@ protocol CallServiceObserver: class {
guard let call = self.call else {
// This should never happen; return to a known good state.
owsFail("\(TAG) call was unexpectedly nil in \(#function)")
owsFail("\(self.logTag) call was unexpectedly nil in \(#function)")
OWSProdError(OWSAnalyticsEvents.callServiceCallMissing(), file: #file, function: #function, line: #line)
handleFailedCurrentCall(error: CallError.assertionError(description: "\(TAG) call unexpectedly nil in \(#function)"))
handleFailedCurrentCall(error: CallError.assertionError(description: "\(self.logTag) call unexpectedly nil in \(#function)"))
return
}
@ -1176,22 +1174,22 @@ protocol CallServiceObserver: class {
guard let call = self.call else {
// This should never happen; return to a known good state.
owsFail("\(TAG) received data message, but there is no current call. Ignoring.")
owsFail("\(self.logTag) received data message, but there is no current call. Ignoring.")
OWSProdError(OWSAnalyticsEvents.callServiceCallMissing(), file: #file, function: #function, line: #line)
handleFailedCurrentCall(error: CallError.assertionError(description: "\(TAG) received data message, but there is no current call. Ignoring."))
handleFailedCurrentCall(error: CallError.assertionError(description: "\(self.logTag) received data message, but there is no current call. Ignoring."))
return
}
if message.hasConnected() {
Logger.debug("\(TAG) remote participant sent Connected via data channel: \(call.identifiersForLogs).")
Logger.debug("\(self.logTag) remote participant sent Connected via data channel: \(call.identifiersForLogs).")
let connected = message.connected!
guard connected.id == call.signalingId else {
// This should never happen; return to a known good state.
owsFail("\(TAG) received connected message for call with id:\(connected.id) but current call has id:\(call.signalingId)")
owsFail("\(self.logTag) received connected message for call with id:\(connected.id) but current call has id:\(call.signalingId)")
OWSProdError(OWSAnalyticsEvents.callServiceCallIdMismatch(), file: #file, function: #function, line: #line)
handleFailedCurrentCall(error: CallError.assertionError(description: "\(TAG) received connected message for call with id:\(connected.id) but current call has id:\(call.signalingId)"))
handleFailedCurrentCall(error: CallError.assertionError(description: "\(self.logTag) received connected message for call with id:\(connected.id) but current call has id:\(call.signalingId)"))
return
}
@ -1199,25 +1197,25 @@ protocol CallServiceObserver: class {
handleConnectedCall(call)
} else if message.hasHangup() {
Logger.debug("\(TAG) remote participant sent Hangup via data channel: \(call.identifiersForLogs).")
Logger.debug("\(self.logTag) remote participant sent Hangup via data channel: \(call.identifiersForLogs).")
let hangup = message.hangup!
guard hangup.id == call.signalingId else {
// This should never happen; return to a known good state.
owsFail("\(TAG) received hangup message for call with id:\(hangup.id) but current call has id:\(call.signalingId)")
owsFail("\(self.logTag) received hangup message for call with id:\(hangup.id) but current call has id:\(call.signalingId)")
OWSProdError(OWSAnalyticsEvents.callServiceCallIdMismatch(), file: #file, function: #function, line: #line)
handleFailedCurrentCall(error: CallError.assertionError(description: "\(TAG) received hangup message for call with id:\(hangup.id) but current call has id:\(call.signalingId)"))
handleFailedCurrentCall(error: CallError.assertionError(description: "\(self.logTag) received hangup message for call with id:\(hangup.id) but current call has id:\(call.signalingId)"))
return
}
handleRemoteHangup(thread: call.thread, callId: hangup.id)
} else if message.hasVideoStreamingStatus() {
Logger.debug("\(TAG) remote participant sent VideoStreamingStatus via data channel: \(call.identifiersForLogs).")
Logger.debug("\(self.logTag) remote participant sent VideoStreamingStatus via data channel: \(call.identifiersForLogs).")
self.isRemoteVideoEnabled = message.videoStreamingStatus.enabled()
} else {
Logger.info("\(TAG) received unknown or empty DataChannelMessage: \(call.identifiersForLogs).")
Logger.info("\(self.logTag) received unknown or empty DataChannelMessage: \(call.identifiersForLogs).")
}
}
@ -1230,7 +1228,7 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
guard peerConnectionClient == self.peerConnectionClient else {
Logger.debug("\(self.TAG) \(#function) Ignoring event from obsolete peerConnectionClient")
Logger.debug("\(self.logTag) \(#function) Ignoring event from obsolete peerConnectionClient")
return
}
@ -1244,7 +1242,7 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
guard peerConnectionClient == self.peerConnectionClient else {
Logger.debug("\(self.TAG) \(#function) Ignoring event from obsolete peerConnectionClient")
Logger.debug("\(self.logTag) \(#function) Ignoring event from obsolete peerConnectionClient")
return
}
@ -1261,7 +1259,7 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
guard peerConnectionClient == self.peerConnectionClient else {
Logger.debug("\(self.TAG) \(#function) Ignoring event from obsolete peerConnectionClient")
Logger.debug("\(self.logTag) \(#function) Ignoring event from obsolete peerConnectionClient")
return
}
@ -1275,7 +1273,7 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
guard peerConnectionClient == self.peerConnectionClient else {
Logger.debug("\(self.TAG) \(#function) Ignoring event from obsolete peerConnectionClient")
Logger.debug("\(self.logTag) \(#function) Ignoring event from obsolete peerConnectionClient")
return
}
@ -1286,7 +1284,7 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
guard peerConnectionClient == self.peerConnectionClient else {
Logger.debug("\(self.TAG) \(#function) Ignoring event from obsolete peerConnectionClient")
Logger.debug("\(self.logTag) \(#function) Ignoring event from obsolete peerConnectionClient")
return
}
@ -1297,7 +1295,7 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
guard peerConnectionClient == self.peerConnectionClient else {
Logger.debug("\(self.TAG) \(#function) Ignoring event from obsolete peerConnectionClient")
Logger.debug("\(self.logTag) \(#function) Ignoring event from obsolete peerConnectionClient")
return
}
@ -1399,7 +1397,7 @@ protocol CallServiceObserver: class {
return firstly {
return accountManager.getTurnServerInfo()
}.then { turnServerInfo -> [RTCIceServer] in
Logger.debug("\(self.TAG) got turn server urls: \(turnServerInfo.urls)")
Logger.debug("\(self.logTag) got turn server urls: \(turnServerInfo.urls)")
return turnServerInfo.urls.map { url in
if url.hasPrefix("turn") {
@ -1412,8 +1410,8 @@ protocol CallServiceObserver: class {
}
} + [CallService.fallbackIceServer]
}.recover { error -> [RTCIceServer] in
Logger.error("\(self.TAG) fetching ICE servers failed with error: \(error)")
Logger.warn("\(self.TAG) using fallback ICE Servers")
Logger.error("\(self.logTag) fetching ICE servers failed with error: \(error)")
Logger.warn("\(self.logTag) using fallback ICE Servers")
return [CallService.fallbackIceServer]
}
@ -1424,7 +1422,7 @@ protocol CallServiceObserver: class {
// that we want to terminate the current call (if any) in order to
// return to a known good state.
public func handleFailedCurrentCall(error: CallError) {
Logger.debug("\(TAG) in \(#function)")
Logger.debug("\(self.logTag) in \(#function)")
// Return to a known good state by ending the current call, if any.
handleFailedCall(failedCall: self.call, error: error)
@ -1458,13 +1456,13 @@ protocol CallServiceObserver: class {
// Only terminate the current call if the error pertains to the current call.
guard failedCall == self.call else {
Logger.debug("\(TAG) in \(#function) ignoring obsolete call: \(failedCall.identifiersForLogs).")
Logger.debug("\(self.logTag) in \(#function) ignoring obsolete call: \(failedCall.identifiersForLogs).")
return
}
Logger.error("\(TAG) call: \(failedCall.identifiersForLogs) failed with error: \(error)")
Logger.error("\(self.logTag) call: \(failedCall.identifiersForLogs) failed with error: \(error)")
} else {
Logger.error("\(TAG) unknown call failed with error: \(error)")
Logger.error("\(self.logTag) unknown call failed with error: \(error)")
}
// Only terminate the call if it is the current call.
@ -1477,20 +1475,20 @@ protocol CallServiceObserver: class {
private func terminateCall() {
AssertIsOnMainThread()
Logger.debug("\(TAG) in \(#function)")
Logger.debug("\(self.logTag) in \(#function)")
self.localVideoTrack = nil
self.remoteVideoTrack = nil
self.isRemoteVideoEnabled = false
self.peerConnectionClient?.terminate()
Logger.debug("\(TAG) setting peerConnectionClient in \(#function)")
Logger.debug("\(self.logTag) setting peerConnectionClient in \(#function)")
self.peerConnectionClient = nil
self.call?.removeAllObservers()
self.call = nil
self.sendIceUpdatesImmediately = true
Logger.info("\(TAG) clearing pendingIceUpdateMessages")
Logger.info("\(self.logTag) clearing pendingIceUpdateMessages")
self.pendingIceUpdateMessages = []
self.fulfillCallConnectedPromise = nil
if let rejectCallConnectedPromise = self.rejectCallConnectedPromise {
@ -1521,13 +1519,13 @@ protocol CallServiceObserver: class {
internal func stateDidChange(call: SignalCall, state: CallState) {
AssertIsOnMainThread()
Logger.info("\(self.TAG) \(#function): \(state)")
Logger.info("\(self.logTag) \(#function): \(state)")
updateIsVideoEnabled()
}
internal func hasLocalVideoDidChange(call: SignalCall, hasLocalVideo: Bool) {
AssertIsOnMainThread()
Logger.info("\(self.TAG) \(#function): \(hasLocalVideo)")
Logger.info("\(self.logTag) \(#function): \(hasLocalVideo)")
self.updateIsVideoEnabled()
}
@ -1577,7 +1575,7 @@ protocol CallServiceObserver: class {
let shouldHaveLocalVideoTrack = self.shouldHaveLocalVideoTrack()
Logger.info("\(self.TAG) \(#function): \(shouldHaveLocalVideoTrack)")
Logger.info("\(self.logTag) \(#function): \(shouldHaveLocalVideoTrack)")
self.peerConnectionClient?.setLocalVideoEnabled(enabled: shouldHaveLocalVideoTrack)
@ -1639,7 +1637,7 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
if self.activeCallTimer != nil {
owsFail("\(TAG) activeCallTimer should only be set once per call")
owsFail("\(self.logTag) activeCallTimer should only be set once per call")
self.activeCallTimer!.invalidate()
self.activeCallTimer = nil
}
@ -1650,7 +1648,7 @@ protocol CallServiceObserver: class {
}
guard let call = strongSelf.call else {
owsFail("\(strongSelf.TAG) call has since ended. Timer should have been invalidated.")
owsFail("\(strongSelf.logTag) call has since ended. Timer should have been invalidated.")
timer.invalidate()
return
}
@ -1675,7 +1673,7 @@ protocol CallServiceObserver: class {
guard nil != frontmostViewController as? CallViewController else {
OWSProdError(OWSAnalyticsEvents.callServiceCallViewCouldNotPresent(), file: #file, function: #function, line: #line)
owsFail("\(TAG) in \(#function) Call terminated due to call view presentation delay: \(frontmostViewController.debugDescription).")
owsFail("\(self.logTag) in \(#function) Call terminated due to call view presentation delay: \(frontmostViewController.debugDescription).")
self.terminateCall()
return
}

View File

@ -17,7 +17,6 @@ import SignalServiceKit
@available(iOS 10.0, *)
final class CallKitCallManager: NSObject {
let TAG = "[CallKitCallManager]"
let callController = CXCallController()
static let kAnonymousCallHandlePrefix = "Signal:"
@ -78,9 +77,9 @@ final class CallKitCallManager: NSObject {
private func requestTransaction(_ transaction: CXTransaction) {
callController.request(transaction) { error in
if let error = error {
Logger.error("\(self.TAG) Error requesting transaction: \(error)")
Logger.error("\(self.logTag) Error requesting transaction: \(error)")
} else {
Logger.debug("\(self.TAG) Requested transaction successfully")
Logger.debug("\(self.logTag) Requested transaction successfully")
}
}
}

View File

@ -19,8 +19,6 @@ public enum PushRegistrationError: Error {
*/
@objc class PushRegistrationManager: NSObject, PKPushRegistryDelegate {
let TAG = "[PushRegistrationManager]"
// MARK - Dependencies
private var pushManager: PushManager {
return PushManager.shared()
@ -48,7 +46,7 @@ public enum PushRegistrationError: Error {
// MARK: Public interface
public func requestPushTokens() -> Promise<(pushToken: String, voipToken: String)> {
Logger.info("\(self.TAG) in \(#function)")
Logger.info("\(self.logTag) in \(#function)")
return self.registerUserNotificationSettings().then {
guard !Platform.isSimulator else {
@ -71,7 +69,7 @@ public enum PushRegistrationError: Error {
@objc
public func didRegisterUserNotificationSettings() {
guard let fulfillUserNotificationSettingsPromise = self.fulfillUserNotificationSettingsPromise else {
owsFail("\(TAG) promise completion in \(#function) unexpectedly nil")
owsFail("\(self.logTag) promise completion in \(#function) unexpectedly nil")
return
}
@ -84,7 +82,7 @@ public enum PushRegistrationError: Error {
@objc
public func didReceiveVanillaPushToken(_ tokenData: Data) {
guard let fulfillVanillaTokenPromise = self.fulfillVanillaTokenPromise else {
owsFail("\(TAG) promise completion in \(#function) unexpectedly nil")
owsFail("\(self.logTag) promise completion in \(#function) unexpectedly nil")
return
}
@ -95,7 +93,7 @@ public enum PushRegistrationError: Error {
@objc
public func didFailToReceiveVanillaPushToken(error: Error) {
guard let rejectVanillaTokenPromise = self.rejectVanillaTokenPromise else {
owsFail("\(TAG) promise completion in \(#function) unexpectedly nil")
owsFail("\(self.logTag) promise completion in \(#function) unexpectedly nil")
return
}
@ -105,17 +103,17 @@ public enum PushRegistrationError: Error {
// MARK: PKPushRegistryDelegate - voIP Push Token
public func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, forType type: PKPushType) {
Logger.info("\(self.TAG) in \(#function)")
Logger.info("\(self.logTag) in \(#function)")
assert(type == .voIP)
self.pushManager.application(UIApplication.shared, didReceiveRemoteNotification: payload.dictionaryPayload)
}
public func pushRegistry(_ registry: PKPushRegistry, didUpdate credentials: PKPushCredentials, forType type: PKPushType) {
Logger.info("\(self.TAG) in \(#function)")
Logger.info("\(self.logTag) in \(#function)")
assert(type == .voIP)
assert(credentials.type == .voIP)
guard let fulfillVoipTokenPromise = self.fulfillVoipTokenPromise else {
owsFail("\(TAG) fulfillVoipTokenPromise was unexpectedly nil")
owsFail("\(self.logTag) fulfillVoipTokenPromise was unexpectedly nil")
return
}
@ -125,7 +123,7 @@ public enum PushRegistrationError: Error {
public func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenForType type: PKPushType) {
// It's not clear when this would happen. We've never previously handled it, but we should at
// least start learning if it happens.
owsFail("\(TAG) in \(#function)")
owsFail("\(self.logTag) in \(#function)")
}
// MARK: helpers
@ -138,7 +136,7 @@ public enum PushRegistrationError: Error {
guard self.userNotificationSettingsPromise == nil else {
let promise = self.userNotificationSettingsPromise!
Logger.info("\(TAG) already registered user notification settings")
Logger.info("\(self.logTag) already registered user notification settings")
return promise
}
@ -146,7 +144,7 @@ public enum PushRegistrationError: Error {
self.userNotificationSettingsPromise = promise
self.fulfillUserNotificationSettingsPromise = fulfill
Logger.info("\(TAG) registering user notification settings")
Logger.info("\(self.logTag) registering user notification settings")
UIApplication.shared.registerUserNotificationSettings(self.pushManager.userNotificationSettings)
@ -179,13 +177,13 @@ public enum PushRegistrationError: Error {
}
private func registerForVanillaPushToken() -> Promise<String> {
Logger.info("\(self.TAG) in \(#function)")
Logger.info("\(self.logTag) in \(#function)")
AssertIsOnMainThread()
guard self.vanillaTokenPromise == nil else {
let promise = vanillaTokenPromise!
assert(promise.isPending)
Logger.info("\(TAG) alreay pending promise for vanilla push token")
Logger.info("\(self.logTag) alreay pending promise for vanilla push token")
return promise.then { $0.hexEncodedString }
}
@ -222,7 +220,7 @@ public enum PushRegistrationError: Error {
owsFail("Device was unexpectedly able to complete push registration even though it was susceptible to failure.")
}
Logger.info("\(self.TAG) successfully registered for vanilla push notifications")
Logger.info("\(self.logTag) successfully registered for vanilla push notifications")
return pushTokenData.hexEncodedString
}.always {
self.vanillaTokenPromise = nil
@ -231,7 +229,7 @@ public enum PushRegistrationError: Error {
private func registerForVoipPushToken() -> Promise<String> {
AssertIsOnMainThread()
Logger.info("\(self.TAG) in \(#function)")
Logger.info("\(self.logTag) in \(#function)")
guard self.voipTokenPromise == nil else {
let promise = self.voipTokenPromise!
@ -254,8 +252,8 @@ public enum PushRegistrationError: Error {
}
guard let voipRegistry = self.voipRegistry else {
owsFail("\(TAG) failed to initialize voipRegistry in \(#function)")
reject(PushRegistrationError.assertionError(description: "\(TAG) failed to initialize voipRegistry in \(#function)"))
owsFail("\(self.logTag) failed to initialize voipRegistry in \(#function)")
reject(PushRegistrationError.assertionError(description: "\(self.logTag) failed to initialize voipRegistry in \(#function)"))
return promise.then { _ in
// coerce expected type of returned promise - we don't really care about the value,
// since this promise has been rejected. In practice this shouldn't happen
@ -266,12 +264,12 @@ public enum PushRegistrationError: Error {
// If we've already completed registering for a voip token, resolve it immediately,
// rather than waiting for the delegate method to be called.
if let voipTokenData = voipRegistry.pushToken(forType: .voIP) {
Logger.info("\(self.TAG) using pre-registered voIP token")
Logger.info("\(self.logTag) using pre-registered voIP token")
fulfill(voipTokenData)
}
return promise.then { (voipTokenData: Data) -> String in
Logger.info("\(self.TAG) successfully registered for voip push notifications")
Logger.info("\(self.logTag) successfully registered for voip push notifications")
return voipTokenData.hexEncodedString
}.always {
self.voipTokenPromise = nil

View File

@ -3,10 +3,6 @@
//
#import "MainAppContext.h"
#import "OWS100RemoveTSRecipientsMigration.h"
#import "OWS102MoveLoggingPreferenceToUserDefaults.h"
#import "OWS103EnableVideoCalling.h"
#import "OWS105AttachmentFilePaths.h"
#import "Signal-Swift.h"
#import <SignalMessaging/Environment.h>
#import <SignalMessaging/OWSProfileManager.h>
@ -53,19 +49,6 @@ NS_ASSUME_NONNULL_BEGIN
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:value];
}
- (NSArray<OWSDatabaseMigration *> *)allMigrations
{
TSStorageManager *storageManager = TSStorageManager.sharedManager;
return @[
[[OWS100RemoveTSRecipientsMigration alloc] initWithStorageManager:storageManager],
[[OWS102MoveLoggingPreferenceToUserDefaults alloc] initWithStorageManager:storageManager],
[[OWS103EnableVideoCalling alloc] initWithStorageManager:storageManager],
// OWS104CreateRecipientIdentities is run separately. See runSafeBlockingMigrations.
[[OWS105AttachmentFilePaths alloc] initWithStorageManager:storageManager],
[[OWS106EnsureProfileComplete alloc] initWithStorageManager:storageManager]
];
}
- (nullable UIViewController *)frontmostViewController
{
return UIApplication.sharedApplication.frontmostViewControllerIgnoringAlerts;
@ -86,6 +69,11 @@ NS_ASSUME_NONNULL_BEGIN
profileManager:OWSProfileManager.sharedManager];
}
- (BOOL)isRunningTests
{
return getenv("runningTests_dontStartApp");
}
@end
NS_ASSUME_NONNULL_END

View File

@ -2,8 +2,6 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "StringUtil.h"
@interface NumberUtil : NSObject
+ (int16_t)congruentDifferenceMod2ToThe16From:(uint16_t)s1 to:(uint16_t)s2;

View File

@ -1,32 +0,0 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "StringUtil.h"
typedef void (^Action)(void);
typedef id (^Function)(void);
@interface Operation : NSObject
@property (nonatomic, readonly, copy) Action callback;
+ (Operation *)operation:(Action)block;
+ (void)asyncRun:(Action)action onThread:(NSThread *)thread;
+ (void)asyncRunAndWaitUntilDone:(Action)action onThread:(NSThread *)thread;
+ (void)asyncRunOnNewThread:(Action)action;
- (void)run;
- (SEL)selectorToRun;
- (void)performOnNewThread;
- (void)performOnThread:(NSThread *)thread;
- (void)performOnThreadAndWaitUntilDone:(NSThread *)thread;
@end

View File

@ -1,53 +0,0 @@
#import "Util.h"
@implementation Operation
+ (Operation *)operation:(Action)block {
ows_require(block != NULL);
Operation *a = [Operation new];
a->_callback = block;
return a;
}
+ (void)asyncRun:(Action)action onThread:(NSThread *)thread {
ows_require(action != nil);
ows_require(thread != nil);
[[Operation operation:action] performOnThread:thread];
}
+ (void)asyncRunAndWaitUntilDone:(Action)action onThread:(NSThread *)thread {
ows_require(action != nil);
ows_require(thread != nil);
[[Operation operation:action] performOnThreadAndWaitUntilDone:thread];
}
+ (void)asyncRunOnNewThread:(Action)action {
ows_require(action != nil);
[[Operation operation:action] performOnNewThread];
}
- (SEL)selectorToRun {
return @selector(run);
}
- (void)performOnThread:(NSThread *)thread {
ows_require(thread != nil);
[self performSelector:@selector(run) onThread:thread withObject:nil waitUntilDone:thread == NSThread.currentThread];
}
- (void)performOnThreadAndWaitUntilDone:(NSThread *)thread {
ows_require(thread != nil);
[self performSelector:@selector(run) onThread:thread withObject:nil waitUntilDone:true];
}
- (void)performOnNewThread {
[NSThread detachNewThreadSelector:[self selectorToRun] toTarget:self withObject:nil];
}
- (void)run {
_callback();
}
@end

View File

@ -1,25 +0,0 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
@interface NSString (Util)
/// The utf-8 encoding of the string's text.
- (NSData *)encodedAsUtf8;
/// The ascii encoding of the string's text.
/// Throws when the string contains non-ascii characters.
- (NSData *)encodedAsAscii;
- (NSRegularExpression *)toRegularExpression;
- (NSString *)withMatchesAgainst:(NSRegularExpression *)regex replacedBy:(NSString *)replacement;
- (bool)containsAnyMatches:(NSRegularExpression *)regex;
- (NSString *)withPrefixRemovedElseNull:(NSString *)prefix;
- (NSDictionary *)decodedAsJsonIntoDictionary;
- (NSNumber *)tryParseAsDecimalNumber;
- (NSNumber *)tryParseAsUnsignedInteger;
- (NSString *)removeAllCharactersIn:(NSCharacterSet *)characterSet;
- (NSString *)digitsOnly;
- (NSString *)withCharactersInRange:(NSRange)range replacedBy:(NSString *)substring;
@end

View File

@ -1,82 +0,0 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "NumberUtil.h"
#import "StringUtil.h"
@implementation NSString (Util)
- (NSData *)encodedAsUtf8 {
NSData *result = [self dataUsingEncoding:NSUTF8StringEncoding];
checkOperationDescribe(result != nil, @"Not a UTF8 string.");
return result;
}
- (NSData *)encodedAsAscii {
NSData *result = [self dataUsingEncoding:NSASCIIStringEncoding];
checkOperationDescribe(result != nil, @"Not an ascii string.");
return result;
}
- (NSRegularExpression *)toRegularExpression {
NSError *regexInitError = NULL;
NSRegularExpression *regex =
[NSRegularExpression regularExpressionWithPattern:self options:0 error:&regexInitError];
checkOperation(regex != nil && regexInitError == NULL);
return regex;
}
- (NSString *)withMatchesAgainst:(NSRegularExpression *)regex replacedBy:(NSString *)replacement {
ows_require(regex != nil);
ows_require(replacement != nil);
NSMutableString *m = self.mutableCopy;
[regex replaceMatchesInString:m options:0 range:NSMakeRange(0, m.length) withTemplate:replacement];
return m;
}
- (bool)containsAnyMatches:(NSRegularExpression *)regex {
ows_require(regex != nil);
return [regex numberOfMatchesInString:self options:0 range:NSMakeRange(0, self.length)] > 0;
}
- (NSString *)withPrefixRemovedElseNull:(NSString *)prefix {
ows_require(prefix != nil);
if (prefix.length > 0 && ![self hasPrefix:prefix])
return nil;
return [self substringFromIndex:prefix.length];
}
- (NSDictionary *)decodedAsJsonIntoDictionary {
NSError *jsonParseError = nil;
id parsedJson = [NSJSONSerialization JSONObjectWithData:self.encodedAsUtf8 options:0 error:&jsonParseError];
checkOperationDescribe(jsonParseError == nil,
([NSString stringWithFormat:@"Json parse error: %@, on json: %@", jsonParseError, self]));
checkOperationDescribe([parsedJson isKindOfClass:NSDictionary.class], @"Unexpected json data");
return parsedJson;
}
- (NSNumber *)tryParseAsDecimalNumber {
NSNumberFormatter *formatter = [NSNumberFormatter new];
[formatter setNumberStyle:NSNumberFormatterDecimalStyle];
// NSNumberFormatter.numberFromString is good at noticing bad inputs, but loses precision for large values
// NSDecimalNumber.decimalNumberWithString has perfect precision, but lets bad inputs through sometimes (e.g.
// "88ffhih" -> 88)
// We use both to get both accuracy and detection of bad inputs
if ([formatter numberFromString:self] == nil) {
return nil;
}
return [NSDecimalNumber decimalNumberWithString:self];
}
- (NSNumber *)tryParseAsUnsignedInteger {
NSNumber *value = [self tryParseAsDecimalNumber];
return value.hasUnsignedIntegerValue ? value : nil;
}
- (NSString *)removeAllCharactersIn:(NSCharacterSet *)characterSet {
ows_require(characterSet != nil);
return [[self componentsSeparatedByCharactersInSet:characterSet] componentsJoinedByString:@""];
}
- (NSString *)digitsOnly {
return [self removeAllCharactersIn:[NSCharacterSet.decimalDigitCharacterSet invertedSet]];
}
- (NSString *)withCharactersInRange:(NSRange)range replacedBy:(NSString *)substring {
NSMutableString *result = self.mutableCopy;
[result replaceCharactersInRange:range withString:substring];
return result;
}
@end

View File

@ -1,9 +0,0 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "DateUtil.h"
#import "NumberUtil.h"
#import "Operation.h"
#import "StringUtil.h"
#import "UIUtil.h"

View File

@ -3,7 +3,6 @@
//
#import "UtilTest.h"
#import "Util.h"
#import "TestUtil.h"
@implementation UtilTest

View File

@ -10,6 +10,8 @@ NS_ASSUME_NONNULL_BEGIN
- (NSString *)rtlSafeAppend:(NSString *)string referenceView:(UIView *)referenceView;
- (NSString *)digitsOnly;
@end
NS_ASSUME_NONNULL_END

View File

@ -26,6 +26,17 @@ NS_ASSUME_NONNULL_BEGIN
}
}
- (NSString *)removeAllCharactersIn:(NSCharacterSet *)characterSet
{
ows_require(characterSet != nil);
return [[self componentsSeparatedByCharactersInSet:characterSet] componentsJoinedByString:@""];
}
- (NSString *)digitsOnly
{
return [self removeAllCharactersIn:[NSCharacterSet.decimalDigitCharacterSet invertedSet]];
}
@end
NS_ASSUME_NONNULL_END

View File

@ -6,9 +6,10 @@
#import "Environment.h"
#import "OWSFormat.h"
#import "OWSProfileManager.h"
#import "Util.h"
#import "ViewControllerUtils.h"
#import <SignalMessaging/SignalMessaging-Swift.h>
#import <SignalMessaging/UIColor+OWS.h>
#import <SignalMessaging/UIFont+OWS.h>
#import <SignalServiceKit/ContactsUpdater.h>
#import <SignalServiceKit/NSNotificationCenter+OWS.h>
#import <SignalServiceKit/OWSError.h>

View File

@ -5,7 +5,6 @@
#import "SignalKeyingStorage.h"
#import "SecurityUtils.h"
#import "TSStorageManager.h"
#import "Util.h"
#define SignalKeyingCollection @"SignalKeyingCollection"

View File

@ -6,7 +6,6 @@
#import "Environment.h"
#import "LockInteractionController.h"
#import "OWSDatabaseMigrationRunner.h"
#import "PushManager.h"
#import "SignalKeyingStorage.h"
#import <SignalServiceKit/AppVersion.h>
#import <SignalServiceKit/NSUserDefaults+OWS.h>
@ -91,25 +90,29 @@
+ (BOOL)isVersion:(NSString *)thisVersionString
atLeast:(NSString *)openLowerBoundVersionString
andLessThan:(NSString *)closedUpperBoundVersionString {
andLessThan:(NSString *)closedUpperBoundVersionString
{
return [self isVersion:thisVersionString atLeast:openLowerBoundVersionString] &&
[self isVersion:thisVersionString lessThan:closedUpperBoundVersionString];
[self isVersion:thisVersionString lessThan:closedUpperBoundVersionString];
}
+ (BOOL)isVersion:(NSString *)thisVersionString atLeast:(NSString *)thatVersionString {
+ (BOOL)isVersion:(NSString *)thisVersionString atLeast:(NSString *)thatVersionString
{
return [thisVersionString compare:thatVersionString options:NSNumericSearch] != NSOrderedAscending;
}
+ (BOOL)isVersion:(NSString *)thisVersionString lessThan:(NSString *)thatVersionString {
+ (BOOL)isVersion:(NSString *)thisVersionString lessThan:(NSString *)thatVersionString
{
return [thisVersionString compare:thatVersionString options:NSNumericSearch] == NSOrderedAscending;
}
#pragma mark Upgrading to 2.1 - Removing video cache folder
+ (void)clearVideoCache {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+ (void)clearVideoCache
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
basePath = [basePath stringByAppendingPathComponent:@"videos"];
basePath = [basePath stringByAppendingPathComponent:@"videos"];
NSError *error;
if ([[NSFileManager defaultManager] fileExistsAtPath:basePath]) {
@ -117,14 +120,15 @@
}
if (error) {
DDLogError(@"An error occured while removing the videos cache folder from old location: %@",
error.debugDescription);
DDLogError(
@"An error occured while removing the videos cache folder from old location: %@", error.debugDescription);
}
}
#pragma mark Upgrading to 2.1.3 - Adding VOIP flag on TS Server
+ (void)blockingAttributesUpdate {
+ (void)blockingAttributesUpdate
{
LIControllerBlockingOperation blockingOperation = ^BOOL(void) {
[[NSUserDefaults appUserDefaults] setObject:@YES forKey:NEEDS_TO_REGISTER_ATTRIBUTES];
@ -167,9 +171,10 @@
#pragma mark Upgrading to 2.3.0
// We removed bloom filter contact discovery. Clean up any local bloom filter data.
+ (void)clearBloomFilterCache {
NSFileManager *fm = [NSFileManager defaultManager];
NSArray *cachesDir = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
+ (void)clearBloomFilterCache
{
NSFileManager *fm = [NSFileManager defaultManager];
NSArray *cachesDir = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *bloomFilterPath = [[cachesDir objectAtIndex:0] stringByAppendingPathComponent:@"bloomfilter"];
if ([fm fileExistsAtPath:bloomFilterPath]) {

View File

@ -1,5 +1,6 @@
// Created by Michael Kirk on 9/28/16.
// Copyright © 2016 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSDatabaseMigration.h"

View File

@ -1,5 +1,6 @@
// Created by Michael Kirk on 9/28/16.
// Copyright © 2016 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWS100RemoveTSRecipientsMigration.h"
#import <YapDatabase/YapDatabaseTransaction.h>

View File

@ -1,5 +1,6 @@
// Created by Michael Kirk on 11/8/16.
// Copyright © 2016 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSDatabaseMigration.h"

View File

@ -1,5 +1,5 @@
//
// Copyright © 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSDatabaseMigration.h"

View File

@ -5,9 +5,9 @@
import Foundation
import PromiseKit
import SignalServiceKit
import SignalMessaging
class OWS106EnsureProfileComplete: OWSDatabaseMigration {
@objc
public class OWS106EnsureProfileComplete: OWSDatabaseMigration {
let TAG = "[OWS106EnsureProfileComplete]"
@ -20,7 +20,7 @@ class OWS106EnsureProfileComplete: OWSDatabaseMigration {
// Overriding runUp since we have some specific completion criteria which
// is more likely to fail since it involves network requests.
override func runUp() {
override public func runUp() {
guard type(of: self).sharedCompleteRegistrationFixerJob == nil else {
owsFail("\(self.TAG) should only be called once.")
return

View File

@ -3,9 +3,13 @@
//
#import "OWSDatabaseMigrationRunner.h"
#import "OWS100RemoveTSRecipientsMigration.h"
#import "OWS102MoveLoggingPreferenceToUserDefaults.h"
#import "OWS103EnableVideoCalling.h"
#import "OWS104CreateRecipientIdentities.h"
#import "OWS105AttachmentFilePaths.h"
#import "OWSDatabaseMigration.h"
#import "Signal-Swift.h"
#import <SignalMessaging/SignalMessaging-Swift.h>
#import <SignalServiceKit/AppContext.h>
NS_ASSUME_NONNULL_BEGIN
@ -24,9 +28,31 @@ NS_ASSUME_NONNULL_BEGIN
return self;
}
// This should all migrations which do NOT qualify as safeBlockingMigrations:
- (NSArray<OWSDatabaseMigration *> *)allMigrations
{
return CurrentAppContext().allMigrations;
TSStorageManager *storageManager = TSStorageManager.sharedManager;
return @[
[[OWS100RemoveTSRecipientsMigration alloc] initWithStorageManager:storageManager],
[[OWS102MoveLoggingPreferenceToUserDefaults alloc] initWithStorageManager:storageManager],
[[OWS103EnableVideoCalling alloc] initWithStorageManager:storageManager],
// OWS104CreateRecipientIdentities is run separately. See runSafeBlockingMigrations.
[[OWS105AttachmentFilePaths alloc] initWithStorageManager:storageManager],
[[OWS106EnsureProfileComplete alloc] initWithStorageManager:storageManager]
];
}
// This should only include migrations which:
//
// a) Do read/write database transactions and therefore would block on the async database
// view registration.
// b) Will not affect any of the data used by the async database views.
- (NSArray<OWSDatabaseMigration *> *)safeBlockingMigrations
{
TSStorageManager *storageManager = TSStorageManager.sharedManager;
return @[
[[OWS104CreateRecipientIdentities alloc] initWithStorageManager:storageManager],
];
}
- (void)assumeAllExistingMigrationsRun
@ -39,14 +65,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)runSafeBlockingMigrations
{
// This should only include migrations which:
//
// a) Do read/write database transactions and therefore would block on the async database
// view registration.
// b) Will not affect any of the data used by the async database views.
[self runMigrations:@[
[[OWS104CreateRecipientIdentities alloc] initWithStorageManager:self.storageManager],
]];
[self runMigrations:self.safeBlockingMigrations];
}
- (void)runAllOutstanding

View File

@ -6,8 +6,8 @@
typedef void (^LIControllerCompletionBlock)(void);
typedef BOOL (^LIControllerBlockingOperation)(void);
typedef void (^LIControllerRetryBlock)(LIControllerBlockingOperation operationBlock,
LIControllerCompletionBlock completionBlock);
typedef void (^LIControllerRetryBlock)(
LIControllerBlockingOperation operationBlock, LIControllerCompletionBlock completionBlock);
+ (void)performBlock:(LIControllerBlockingOperation)blockingOperation
completionBlock:(LIControllerCompletionBlock)completionBlock

View File

@ -0,0 +1,95 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "LockInteractionController.h"
@interface LockInteractionController ()
@property UIAlertController *alertController;
@end
@implementation LockInteractionController
+ (instancetype)sharedController
{
static LockInteractionController *sharedController = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedController = [self new];
});
return sharedController;
}
+ (void)performBlock:(LIControllerBlockingOperation)blockingOperation
completionBlock:(LIControllerCompletionBlock)completionBlock
retryBlock:(LIControllerRetryBlock)retryBlock
usesNetwork:(BOOL)networkFlag
{
if (networkFlag) {
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:networkFlag];
}
LockInteractionController *sharedController = [LockInteractionController sharedController];
sharedController.alertController =
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"Upgrading Signal ...", nil)
message:nil
preferredStyle:UIAlertControllerStyleAlert];
[[UIApplication sharedApplication].keyWindow.rootViewController
presentViewController:sharedController.alertController
animated:YES
completion:nil];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
BOOL success = blockingOperation();
dispatch_async(dispatch_get_main_queue(), ^{
[sharedController.alertController
dismissViewControllerAnimated:YES
completion:^{
if (networkFlag) {
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
}
if (!success) {
retryBlock(blockingOperation, completionBlock);
} else {
completionBlock();
}
}];
});
});
}
+ (LIControllerRetryBlock)defaultNetworkRetry
{
LIControllerRetryBlock retryBlock = ^void(
LIControllerBlockingOperation blockingOperation, LIControllerCompletionBlock completionBlock) {
UIAlertController *retryController =
[UIAlertController alertControllerWithTitle:@"Upgrading Signal failed"
message:@"An network error occured while upgrading, please check "
@"your connectivity and try again."
preferredStyle:UIAlertControllerStyleAlert];
[retryController
addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"REGISTER_FAILED_TRY_AGAIN", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
[self performBlock:blockingOperation
completionBlock:completionBlock
retryBlock:[LockInteractionController defaultNetworkRetry]
usesNetwork:YES];
}]];
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:retryController
animated:YES
completion:nil];
};
return retryBlock;
}
@end

View File

@ -8,7 +8,7 @@ NS_ASSUME_NONNULL_BEGIN
extern NSString *const TSRegistrationErrorDomain;
extern NSString *const TSRegistrationErrorUserInfoHTTPStatus;
extern NSString *const kNSNotificationName_RegistrationStateDidChange;
extern NSString *const RegistrationStateDidChangeNotification;
extern NSString *const kNSNotificationName_LocalNumberDidChange;
@class TSNetworkManager;

View File

@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
NSString *const TSRegistrationErrorDomain = @"TSRegistrationErrorDomain";
NSString *const TSRegistrationErrorUserInfoHTTPStatus = @"TSHTTPStatus";
NSString *const kNSNotificationName_RegistrationStateDidChange = @"kNSNotificationName_RegistrationStateDidChange";
NSString *const RegistrationStateDidChangeNotification = @"RegistrationStateDidChangeNotification";
NSString *const kNSNotificationName_LocalNumberDidChange = @"kNSNotificationName_LocalNumberDidChange";
NSString *const TSAccountManager_RegisteredNumberKey = @"TSStorageRegisteredNumberKey";
@ -124,7 +124,7 @@ NSString *const TSAccountManager_ServerSignalingKey = @"TSStorageServerSignaling
[self storeLocalNumber:phoneNumber];
[[NSNotificationCenter defaultCenter] postNotificationNameAsync:kNSNotificationName_RegistrationStateDidChange
[[NSNotificationCenter defaultCenter] postNotificationNameAsync:RegistrationStateDidChangeNotification
object:nil
userInfo:nil];
@ -435,13 +435,12 @@ NSString *const TSAccountManager_ServerSignalingKey = @"TSStorageServerSignaling
// This is called from `[AppSettingsViewController proceedToUnregistration]` whose
// success handler calls `[Environment resetAppData]`.
// This method, after calling that success handler, fires
// `kNSNotificationName_RegistrationStateDidChange` which is only safe to fire after
// `RegistrationStateDidChangeNotification` which is only safe to fire after
// the data store is reset.
[[NSNotificationCenter defaultCenter]
postNotificationNameAsync:kNSNotificationName_RegistrationStateDidChange
object:nil
userInfo:nil];
[[NSNotificationCenter defaultCenter] postNotificationNameAsync:RegistrationStateDidChangeNotification
object:nil
userInfo:nil];
}
failure:^(NSURLSessionDataTask *task, NSError *error) {
if (!IsNSErrorNetworkFailure(error)) {

View File

@ -4,7 +4,6 @@
#import "PhoneNumberUtil.h"
#import "ContactsManagerProtocol.h"
#import "Util.h"
#import "FunctionalUtil.h"
#import <libPhoneNumber_iOS/NBPhoneNumber.h>

View File

@ -260,7 +260,7 @@ NSString *const OWSMessageContentJobFinderExtensionGroup = @"OWSMessageContentJo
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(databaseViewRegistrationComplete)
name:kNSNotificationName_DatabaseViewRegistrationComplete
name:DatabaseViewRegistrationCompleteNotification
object:nil];
return self;

View File

@ -113,6 +113,7 @@ NS_ASSUME_NONNULL_BEGIN
_blockingManager = [OWSBlockingManager sharedManager];
OWSSingletonAssert();
OWSAssert(CurrentAppContext().isMainApp);
[self startObserving];

View File

@ -240,7 +240,7 @@ NSString *const OWSMessageDecryptJobFinderExtensionGroup = @"OWSMessageProcessin
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(databaseViewRegistrationComplete)
name:kNSNotificationName_DatabaseViewRegistrationComplete
name:DatabaseViewRegistrationCompleteNotification
object:nil];
return self;

View File

@ -175,7 +175,7 @@ NSString *const OWSReadReceiptManagerAreReadReceiptsEnabled = @"areReadReceiptsE
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(databaseViewRegistrationComplete)
name:kNSNotificationName_DatabaseViewRegistrationComplete
name:DatabaseViewRegistrationCompleteNotification
object:nil];
// Try to start processing.

View File

@ -74,7 +74,7 @@ NSString *const kNSNotificationName_IsCensorshipCircumventionActiveDidChange =
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(registrationStateDidChange:)
name:kNSNotificationName_RegistrationStateDidChange
name:RegistrationStateDidChangeNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(localNumberDidChange:)

View File

@ -133,7 +133,7 @@ NSString *const kNSNotification_SocketManagerStateDidChange = @"kNSNotification_
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(registrationStateDidChange:)
name:kNSNotificationName_RegistrationStateDidChange
name:RegistrationStateDidChangeNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(isCensorshipCircumventionActiveDidChange:)

View File

@ -4,7 +4,7 @@
#import <YapDatabase/YapDatabaseViewTransaction.h>
extern NSString *const kNSNotificationName_DatabaseViewRegistrationComplete;
extern NSString *const DatabaseViewRegistrationCompleteNotification;
extern NSString *const TSInboxGroup;
extern NSString *const TSArchiveGroup;

View File

@ -14,8 +14,7 @@
#import <YapDatabase/YapDatabaseCrossProcessNotification.h>
#import <YapDatabase/YapDatabaseView.h>
NSString *const kNSNotificationName_DatabaseViewRegistrationComplete =
@"kNSNotificationName_DatabaseViewRegistrationComplete";
NSString *const DatabaseViewRegistrationCompleteNotification = @"DatabaseViewRegistrationCompleteNotification";
NSString *const TSInboxGroup = @"TSInboxGroup";
NSString *const TSArchiveGroup = @"TSArchiveGroup";
@ -452,10 +451,9 @@ NSString *const TSSecondaryDevicesDatabaseViewExtensionName = @"TSSecondaryDevic
asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) {
[TSDatabaseView.sharedInstance setAreAllAsyncRegistrationsComplete];
[[NSNotificationCenter defaultCenter]
postNotificationNameAsync:kNSNotificationName_DatabaseViewRegistrationComplete
object:nil
userInfo:nil];
[[NSNotificationCenter defaultCenter] postNotificationNameAsync:DatabaseViewRegistrationCompleteNotification
object:nil
userInfo:nil];
}];
}

View File

@ -353,7 +353,7 @@ void setDatabaseInitialized()
[failedAttachmentDownloadsMessagesJob asyncRegisterDatabaseExtensions];
// NOTE: [TSDatabaseView asyncRegistrationCompletion] ensures that
// kNSNotificationName_DatabaseViewRegistrationComplete is not fired until all
// DatabaseViewRegistrationCompleteNotification is not fired until all
// of the async registrations are complete.
[TSDatabaseView asyncRegistrationCompletion];
}

View File

@ -7,7 +7,6 @@ NS_ASSUME_NONNULL_BEGIN
typedef void (^BackgroundTaskExpirationHandler)(void);
@class OWSAES256Key;
@class OWSDatabaseMigration;
@protocol AppContext <NSObject>
@ -31,8 +30,6 @@ typedef void (^BackgroundTaskExpirationHandler)(void);
- (BOOL)isRTL;
- (NSArray<OWSDatabaseMigration *> *)allMigrations;
// Returns the VC that should be used to present alerts, modals, etc.
- (nullable UIViewController *)frontmostViewController;
@ -43,6 +40,8 @@ typedef void (^BackgroundTaskExpirationHandler)(void);
// but should only be necessary to call if isMainApp is YES.
- (void)doMultiDeviceUpdateWithProfileKey:(OWSAES256Key *)profileKey;
- (BOOL)isRunningTests;
@end
id<AppContext> CurrentAppContext(void);

View File

@ -0,0 +1,28 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
import SignalServiceKit
class SAECallMessageHandler: NSObject, OWSCallMessageHandler {
public func receivedOffer(_ offer: OWSSignalServiceProtosCallMessageOffer, from callerId: String) {
owsFail("\(self.logTag) in \(#function).")
}
public func receivedAnswer(_ answer: OWSSignalServiceProtosCallMessageAnswer, from callerId: String) {
owsFail("\(self.logTag) in \(#function).")
}
public func receivedIceUpdate(_ iceUpdate: OWSSignalServiceProtosCallMessageIceUpdate, from callerId: String) {
owsFail("\(self.logTag) in \(#function).")
}
public func receivedHangup(_ hangup: OWSSignalServiceProtosCallMessageHangup, from callerId: String) {
owsFail("\(self.logTag) in \(#function).")
}
public func receivedBusy(_ busy: OWSSignalServiceProtosCallMessageBusy, from callerId: String) {
owsFail("\(self.logTag) in \(#function).")
}
}

View File

@ -0,0 +1,16 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
import SignalServiceKit
class SAENotificationsManager: NSObject, NotificationsProtocol {
public func notifyUser(for incomingMessage: TSIncomingMessage!, in thread: TSThread!, contactsManager: ContactsManagerProtocol!, transaction: YapDatabaseReadTransaction!) {
owsFail("\(self.logTag) in \(#function).")
}
public func notifyUser(for error: TSErrorMessage!, in thread: TSThread!) {
owsFail("\(self.logTag) in \(#function).")
}
}

View File

@ -8,11 +8,14 @@ import SignalMessaging
import PureLayout
import SignalServiceKit
class ShareViewController: UINavigationController, SAELoadViewDelegate {
@objc
public class ShareViewController: UINavigationController, SAELoadViewDelegate {
override func loadView() {
override open func loadView() {
super.loadView()
Logger.debug("\(self.logTag()) \(#function)")
// This should be the first thing we do.
SetCurrentAppContext(ShareAppExtensionContext(rootViewController:self))
@ -33,6 +36,7 @@ class ShareViewController: UINavigationController, SAELoadViewDelegate {
// XXX - careful when moving this. It must happen before we initialize TSStorageManager.
TSStorageManager.verifyDBKeysAvailableBeforeBackgroundLaunch()
// TODO:
// // Prevent the device from sleeping during database view async registration
// // (e.g. long database upgrades).
// //
@ -41,57 +45,65 @@ class ShareViewController: UINavigationController, SAELoadViewDelegate {
setupEnvironment()
// TODO:
// [UIUtil applySignalAppearence];
//
// if (getenv("runningTests_dontStartApp")) {
// return YES;
// }
//
// self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
//
// // Show the launch screen until the async database view registrations are complete.
// self.window.rootViewController = [self loadingRootViewController];
//
// [self.window makeKeyAndVisible];
//
// // performUpdateCheck must be invoked after Environment has been initialized because
// // upgrade process may depend on Environment.
// [VersionMigrations performUpdateCheck];
//
// // Accept push notification when app is not open
// NSDictionary *remoteNotif = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey];
// if (remoteNotif) {
// DDLogInfo(@"Application was launched by tapping a push notification.");
// [self application:application didReceiveRemoteNotification:remoteNotif];
// }
//
// [self prepareScreenProtection];
//
// self.contactsSyncing = [[OWSContactsSyncing alloc] initWithContactsManager:[Environment current].contactsManager
// identityManager:[OWSIdentityManager sharedManager]
// messageSender:[Environment current].messageSender
// profileManager:[OWSProfileManager sharedManager]];
//
// [[NSNotificationCenter defaultCenter] addObserver:self
// selector:@selector(databaseViewRegistrationComplete)
// name:kNSNotificationName_DatabaseViewRegistrationComplete
// object:nil];
// [[NSNotificationCenter defaultCenter] addObserver:self
// selector:@selector(registrationStateDidChange)
// name:kNSNotificationName_RegistrationStateDidChange
// object:nil];
//
// DDLogInfo(@"%@ application: didFinishLaunchingWithOptions completed.", self.logTag);
//
// [OWSAnalytics appLaunchDidBegin];
//
// return YES;
Logger.debug("\(self.logTag()) \(#function)")
if CurrentAppContext().isRunningTests() {
// TODO: Do we need to implement isRunningTests in the SAE context?
return
}
// performUpdateCheck must be invoked after Environment has been initialized because
// upgrade process may depend on Environment.
VersionMigrations.performUpdateCheck()
let loadViewController = SAELoadViewController(delegate:self)
self.pushViewController(loadViewController, animated: false)
self.isNavigationBarHidden = false
// TODO:
// [self prepareScreenProtection];
// TODO:
// self.contactsSyncing = [[OWSContactsSyncing alloc] initWithContactsManager:[Environment current].contactsManager
// identityManager:[OWSIdentityManager sharedManager]
// messageSender:[Environment current].messageSender
// profileManager:[OWSProfileManager sharedManager]];
NotificationCenter.default.addObserver(self,
selector: #selector(databaseViewRegistrationComplete),
name: .DatabaseViewRegistrationComplete,
object: nil)
NotificationCenter.default.addObserver(self,
selector: #selector(registrationStateDidChange),
name: .RegistrationStateDidChange,
object: nil)
Logger.info("\(self.logTag) application: didFinishLaunchingWithOptions completed.")
OWSAnalytics.appLaunchDidBegin()
}
deinit {
NotificationCenter.default.removeObserver(self)
}
@objc
func databaseViewRegistrationComplete() {
AssertIsOnMainThread()
Logger.debug("\(self.logTag()) \(#function)")
// TODO:
}
@objc
func registrationStateDidChange() {
AssertIsOnMainThread()
Logger.debug("\(self.logTag()) \(#function)")
// TODO:
}
func startupLogging() {
@ -119,29 +131,29 @@ class ShareViewController: UINavigationController, SAELoadViewDelegate {
}
func setupEnvironment() {
Environment.setCurrent(Release.releaseEnvironment())
let environment = Release.releaseEnvironment()
Environment.setCurrent(environment)
// TODO:
// // Encryption/Descryption mutates session state and must be synchronized on a serial queue.
// [SessionCipher setSessionCipherDispatchQueue:[OWSDispatch sessionStoreQueue]];
//
// TextSecureKitEnv *sharedEnv =
// [[TextSecureKitEnv alloc] initWithCallMessageHandler:SignalApp.sharedApp.callMessageHandler
// contactsManager:[Environment current].contactsManager
// messageSender:[Environment current].messageSender
// notificationsManager:SignalApp.sharedApp.notificationsManager
// profileManager:OWSProfileManager.sharedManager];
// [TextSecureKitEnv setSharedEnv:sharedEnv];
//
// [[TSStorageManager sharedManager] setupDatabaseWithSafeBlockingMigrations:^{
// [VersionMigrations runSafeBlockingMigrations];
// }];
// [[Environment current].contactsManager startObserving];
// Encryption/Decryption mutates session state and must be synchronized on a serial queue.
SessionCipher.setSessionCipherDispatchQueue(OWSDispatch.sessionStoreQueue())
let sharedEnv = TextSecureKitEnv(callMessageHandler:SAECallMessageHandler(),
contactsManager:Environment.current().contactsManager,
messageSender:Environment.current().messageSender,
notificationsManager:SAENotificationsManager(),
profileManager:OWSProfileManager.shared())
TextSecureKitEnv.setShared(sharedEnv)
TSStorageManager.shared().setupDatabase(safeBlockingMigrations: {
VersionMigrations.runSafeBlockingMigrations()
})
Environment.current().contactsManager.startObserving()
}
// MARK: View Lifecycle
override func viewDidLoad() {
override open func viewDidLoad() {
super.viewDidLoad()
let proofOfSharedFramework = StorageCoordinator.shared.path
@ -156,13 +168,13 @@ class ShareViewController: UINavigationController, SAELoadViewDelegate {
Logger.debug("\(self.logTag()) \(#function)")
}
override func viewWillAppear(_ animated: Bool) {
override open func viewWillAppear(_ animated: Bool) {
Logger.debug("\(self.logTag()) \(#function)")
super.viewWillAppear(animated)
}
override func viewDidAppear(_ animated: Bool) {
override open func viewDidAppear(_ animated: Bool) {
Logger.debug("\(self.logTag()) \(#function)")
super.viewDidAppear(animated)

View File

@ -8,6 +8,7 @@
// Separate iOS Frameworks from other imports.
#import "DebugLogger.h"
#import "Environment.h"
#import "OWSContactsManager.h"
#import "OWSLogger.h"
#import "OWSMath.h"
#import "OWSPreferences.h"
@ -16,7 +17,10 @@
#import "UIColor+OWS.h"
#import "UIFont+OWS.h"
#import "UIView+OWS.h"
#import "VersionMigrations.h"
#import <SignalServiceKit/AppContext.h>
#import <SignalServiceKit/AppVersion.h>
#import <SignalServiceKit/Asserts.h>
#import <SignalServiceKit/NSObject+OWS.h>
#import <SignalServiceKit/OWSMessageSender.h>
#import <SignalServiceKit/TSAccountManager.h>

View File

@ -75,11 +75,6 @@ NS_ASSUME_NONNULL_BEGIN
OWSFail(@"%@ called %s.", self.logTag, __PRETTY_FUNCTION__);
}
- (NSArray<OWSDatabaseMigration *> *)allMigrations
{
return @[];
}
- (nullable UIViewController *)frontmostViewController
{
OWSAssert(self.rootViewController);
@ -97,6 +92,12 @@ NS_ASSUME_NONNULL_BEGIN
OWSFail(@"%@ called %s.", self.logTag, __PRETTY_FUNCTION__);
}
- (BOOL)isRunningTests
{
// TODO: I don't think we'll need to distinguish this in the SAE.
return NO;
}
@end
NS_ASSUME_NONNULL_END