diff --git a/Scripts/reverse_integration_check.py b/Scripts/reverse_integration_check.py index 2221481bf4..ecfc162464 100755 --- a/Scripts/reverse_integration_check.py +++ b/Scripts/reverse_integration_check.py @@ -81,7 +81,9 @@ def main(): # Looks like this tag was erroneously applied before rebasing. # After rebasing, HEAD was retagged with 2.41.0.2 '2.41.0.1', - # + # internal builds, not marked as such + '2.44.0.0', + '2.44.0.3' ] tags_of_concern = [tag for tag in tags_of_concern if tag not in tags_to_ignore] diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index dd4acebb09..f9abf2ffcb 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -566,6 +566,7 @@ 8809CE8122F534B200D38867 /* CustomKeyboard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8809CE8022F534B200D38867 /* CustomKeyboard.swift */; }; 8809CE8722F8FE6D00D38867 /* AttachmentKeyboard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8809CE8622F8FE6D00D38867 /* AttachmentKeyboard.swift */; }; 8809CE8A22F93C2200D38867 /* RecentPhotoCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8809CE8922F93C2200D38867 /* RecentPhotoCollectionView.swift */; }; + 880C0FF7233D3F7C00386FB8 /* playPauseButton.json in Resources */ = {isa = PBXBuildFile; fileRef = 880C0FF6233D3F7C00386FB8 /* playPauseButton.json */; }; 8810223722DF9C2300A7C44F /* OnboardingAccountLockedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8810223622DF9C2300A7C44F /* OnboardingAccountLockedViewController.swift */; }; 8811CF842295D8DA00FF6549 /* VolumeButtons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8811CF832295D8DA00FF6549 /* VolumeButtons.swift */; }; 8813F6E12330082900ADEC6A /* AudioWaveformProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88A695BC232C18DF002F7B9B /* AudioWaveformProgressView.swift */; }; @@ -584,7 +585,6 @@ 88A9729222FA5D4B004B4FBF /* AttachmentFormatPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88A9729122FA5D4B004B4FBF /* AttachmentFormatPickerView.swift */; }; 88A9729422FB4D02004B4FBF /* LocationPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88A9729322FB4D02004B4FBF /* LocationPicker.swift */; }; 88BFD4732335C2B3001797D7 /* waveformLoading.json in Resources */ = {isa = PBXBuildFile; fileRef = 88BFD4722335C2B3001797D7 /* waveformLoading.json */; }; - 88BFD4752335C2DB001797D7 /* playPauseButton.json in Resources */ = {isa = PBXBuildFile; fileRef = 88BFD4742335C2DB001797D7 /* playPauseButton.json */; }; 88D1D40222EBB5A100F472C5 /* MessageRequestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88D1D40122EBB5A100F472C5 /* MessageRequestView.swift */; }; 88D1D40422EF8A9700F472C5 /* ThreadDetailsInteraction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88D1D40322EF8A9700F472C5 /* ThreadDetailsInteraction.swift */; }; 88D1D40622EF8F1100F472C5 /* ThreadDetailsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88D1D40522EF8F1100F472C5 /* ThreadDetailsCell.swift */; }; @@ -1373,6 +1373,7 @@ 8809CE8422F8DB2D00D38867 /* AttachmentKeyboard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AttachmentKeyboard.swift; sourceTree = ""; }; 8809CE8622F8FE6D00D38867 /* AttachmentKeyboard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AttachmentKeyboard.swift; sourceTree = ""; }; 8809CE8922F93C2200D38867 /* RecentPhotoCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentPhotoCollectionView.swift; sourceTree = ""; }; + 880C0FF6233D3F7C00386FB8 /* playPauseButton.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = playPauseButton.json; sourceTree = ""; }; 8810223622DF9C2300A7C44F /* OnboardingAccountLockedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingAccountLockedViewController.swift; sourceTree = ""; }; 8811CF832295D8DA00FF6549 /* VolumeButtons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VolumeButtons.swift; sourceTree = ""; }; 881677C422DD2B21007BAF49 /* OWSPinReminderViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OWSPinReminderViewController.swift; sourceTree = ""; }; @@ -1392,7 +1393,6 @@ 88A9729122FA5D4B004B4FBF /* AttachmentFormatPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AttachmentFormatPickerView.swift; sourceTree = ""; }; 88A9729322FB4D02004B4FBF /* LocationPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationPicker.swift; sourceTree = ""; }; 88BFD4722335C2B3001797D7 /* waveformLoading.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = waveformLoading.json; sourceTree = ""; }; - 88BFD4742335C2DB001797D7 /* playPauseButton.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = playPauseButton.json; sourceTree = ""; }; 88D1D40122EBB5A100F472C5 /* MessageRequestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageRequestView.swift; sourceTree = ""; }; 88D1D40322EF8A9700F472C5 /* ThreadDetailsInteraction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreadDetailsInteraction.swift; sourceTree = ""; }; 88D1D40522EF8F1100F472C5 /* ThreadDetailsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThreadDetailsCell.swift; sourceTree = ""; }; @@ -2694,7 +2694,7 @@ 88BFD4712335C2A4001797D7 /* Lottie */ = { isa = PBXGroup; children = ( - 88BFD4742335C2DB001797D7 /* playPauseButton.json */, + 880C0FF6233D3F7C00386FB8 /* playPauseButton.json */, 88BFD4722335C2B3001797D7 /* waveformLoading.json */, ); path = Lottie; @@ -3304,9 +3304,9 @@ 34330A5A1E7875FB00DF2FB9 /* fontawesome-webfont.ttf in Resources */, A5509ECA1A69AB8B00ABA4BC /* Main.storyboard in Resources */, 34330A5C1E787A9800DF2FB9 /* dripicons-v2.ttf in Resources */, + 880C0FF7233D3F7C00386FB8 /* playPauseButton.json in Resources */, B6F509971AA53F760068F56A /* Localizable.strings in Resources */, B66DBF4A19D5BBC8006EA940 /* Images.xcassets in Resources */, - 88BFD4752335C2DB001797D7 /* playPauseButton.json in Resources */, 34CF0788203E6B78005C4D61 /* ringback_tone_ansi.caf in Resources */, 34C3C78F2040A4F70000134C /* sonarping.mp3 in Resources */, 34661FB820C1C0D60056EDD6 /* message_sent.aiff in Resources */, diff --git a/Signal/Lottie/playPauseButton.json b/Signal/Lottie/playPauseButton.json index 9960fe2ae7..a44d0d88a9 100644 --- a/Signal/Lottie/playPauseButton.json +++ b/Signal/Lottie/playPauseButton.json @@ -1 +1 @@ -{"v":"5.5.2","fr":60,"ip":0,"op":30,"w":24,"h":24,"nm":"lottie-assets2","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Play Outlines 3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"t":28,"s":[90]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":0,"s":[14,12,0],"to":[-0.333,0,0],"ti":[0.333,0,0]},{"t":28,"s":[12,12,0]}],"ix":2},"a":{"a":0,"k":[7.25,8.25,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[-7,-4],[-7,4],[7,4],[6.888,3.936]],"c":true}]},{"t":28,"s":[{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[-8,-1.969],[-7.984,1.999],[8,1.999],[7.998,-1.997]],"c":true}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[7.25,4.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":30,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Play Outlines 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"t":28,"s":[90]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":0,"s":[14,12,0],"to":[-0.333,0,0],"ti":[0.333,0,0]},{"t":28,"s":[12,12,0]}],"ix":2},"a":{"a":0,"k":[7.25,8.25,0],"ix":1},"s":{"a":0,"k":[100,-100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[-7,-4],[-7,4],[7,4],[6.888,3.936]],"c":true}]},{"t":28,"s":[{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[-8,-1.969],[-7.984,1.999],[8,1.999],[7.998,-1.997]],"c":true}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[7.25,4.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":30,"st":0,"bm":0}],"markers":[]} +{"v":"5.5.9","fr":60,"ip":0,"op":30,"w":28,"h":28,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Play 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"t":28,"s":[90]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[15.111,14,0],"to":[-0.183,0,0],"ti":[0.183,0,0]},{"t":28,"s":[14.011,14,0]}],"ix":2},"a":{"a":0,"k":[0,-5.2,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[{"i":[[0,0],[0,0.825],[0,0],[0,0],[-0.222,-0.002],[0.093,-0.134],[0.153,-0.057],[0,0],[0,0]],"o":[[-0.716,0.414],[0,0],[0,0],[0,0],[0,0.163],[-0.093,0.134],[0,0],[0,0],[0,0]],"v":[[-7.811,5.035],[-9.111,4.287],[-9.111,-5.168],[-9.111,-5.213],[9.111,-5.211],[8.968,-4.754],[8.589,-4.461],[8.581,-4.456],[8.526,-4.424]],"c":true}]},{"t":28,"s":[{"i":[[0,0],[-0.005,0.388],[0,0.202],[-0.4,0.001],[-0.222,-0.002],[0.005,-0.402],[-0.001,-0.198],[-0.001,-0.09],[0.399,0.003]],"o":[[-0.404,0],[0,0],[-0.005,-0.405],[0,0],[0.404,0.001],[0,0.195],[0,0],[-0.001,0.404],[-0.586,-0.004]],"v":[[-9.41,2.811],[-10.003,2.219],[-10.003,-2.587],[-9.404,-3.19],[9.401,-3.188],[10.004,-2.593],[10.003,2.017],[10.003,2.21],[9.409,2.808]],"c":true}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[99.952,100.017],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":30,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Play","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"t":28,"s":[90]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[15.111,13.987,0],"to":[-0.183,0,0],"ti":[0.183,0,0]},{"t":28,"s":[14.011,13.987,0]}],"ix":2},"a":{"a":0,"k":[0,5.2,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[{"i":[[0,0],[-0.093,-0.134],[0,-0.163],[0,0],[0,0],[0,0],[-0.716,-0.414],[0,0],[0,0]],"o":[[0.153,0.057],[0.093,0.134],[-0.222,0.002],[0,0],[0,0],[0,-0.825],[0,0],[0,0],[0,0]],"v":[[8.589,4.461],[8.968,4.754],[9.111,5.211],[-9.111,5.213],[-9.111,5.202],[-9.111,-4.287],[-7.811,-5.035],[8.576,4.453],[8.588,4.46]],"c":true}]},{"t":28,"s":[{"i":[[0,0],[-0.001,-0.126],[0.395,0],[0,0],[0,0.392],[0,0],[-0.398,0],[-0.241,0.001],[0,-0.403]],"o":[[0.002,0.152],[0,0.396],[-0.222,0.002],[-0.402,0],[0,-0.1],[0,-0.396],[0,0],[0.397,0],[0.001,0.072]],"v":[[10.01,-1.986],[10.012,2.618],[9.415,3.21],[-9.386,3.208],[-9.987,2.615],[-9.987,-2.191],[-9.389,-2.788],[9.413,-2.788],[10.011,-2.189]],"c":true}]}],"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":30,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index 11f1614e1a..bf3cdf5809 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -47,7 +47,7 @@ CFBundleVersion - 2.44.0.0 + 2.44.0.5 ITSAppUsesNonExemptEncryption LOGS_EMAIL diff --git a/Signal/src/ViewControllers/ConversationView/Cells/AudioMessageView.swift b/Signal/src/ViewControllers/ConversationView/Cells/AudioMessageView.swift index f0597efc81..6ce890a775 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/AudioMessageView.swift +++ b/Signal/src/ViewControllers/ConversationView/Cells/AudioMessageView.swift @@ -63,8 +63,12 @@ class AudioMessageView: UIStackView { addArrangedSubview(topLabel) } - // TODO: Adjust the animation speed once we get the final animation - playPauseAnimation.animationSpeed = 2 + // TODO: There is a bug with Lottie where animations lag when there are a lot + // of other things happening on screen. Since this animation generally plays + // when the progress bar / waveform is rendering we speed up the playback to + // address some of the lag issues. Once this is fixed we should update lottie + // and remove this check. https://github.com/airbnb/lottie-ios/issues/1034 + playPauseAnimation.animationSpeed = 3 playPauseAnimation.backgroundBehavior = .forceFinish playPauseAnimation.contentMode = .scaleAspectFit playPauseAnimation.autoSetDimensions(to: CGSize(square: animationSize)) @@ -150,7 +154,7 @@ class AudioMessageView: UIStackView { private static var labelFont: UIFont = .ows_dynamicTypeCaption2 private static var waveformHeight: CGFloat = 35 private static var vMargin: CGFloat = 4 - private var animationSize: CGFloat = 30 + private var animationSize: CGFloat = 28 private var iconSize: CGFloat = 24 private var hMargin: CGFloat = 0 private var hSpacing: CGFloat = 12 diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageViewOnceView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageViewOnceView.m index d9108447e8..4e8feb232c 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageViewOnceView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageViewOnceView.m @@ -14,6 +14,12 @@ NS_ASSUME_NONNULL_BEGIN +typedef NS_ENUM(NSUInteger, ViewOnceMessageType) { + ViewOnceMessageType_Unknown = 0, + ViewOnceMessageType_Photo, + ViewOnceMessageType_Video, +}; + @interface OWSMessageViewOnceView () @property (nonatomic) OWSBubbleView *bubbleView; @@ -81,7 +87,7 @@ NS_ASSUME_NONNULL_BEGIN self.senderNameContainer = [UIView new]; self.senderNameContainer.layoutMargins = UIEdgeInsetsMake(0, 0, self.senderNameBottomSpacing, 0); [self.senderNameContainer addSubview:self.senderNameLabel]; - [self.senderNameLabel ows_autoPinToSuperviewMargins]; + [self.senderNameLabel autoPinEdgesToSuperviewMargins]; self.iconView = [UIImageView new]; [self.iconView setContentHuggingHigh]; @@ -405,6 +411,27 @@ NS_ASSUME_NONNULL_BEGIN // Do nothing. } +- (ViewOnceMessageType)viewOnceMessageType +{ + if (self.viewItem.attachmentStream == nil) { + // The attachment doesn't exist for outgoing + // messages so we'd need to store the content type if + // we wanted to distinguish between photo and video + + // For incoming messages viewed messages, it doesn't matter + // because we show generic "View" text, regardless of the + // content type + return ViewOnceMessageType_Unknown; + } + + if (self.viewItem.attachmentStream.isVideo) { + return ViewOnceMessageType_Video; + } else { + OWSAssertDebug(self.viewItem.attachmentStream.isImage || self.viewItem.attachmentStream.isAnimated); + return ViewOnceMessageType_Photo; + } +} + #pragma mark - Subviews - (void)configureLabel @@ -435,9 +462,18 @@ NS_ASSUME_NONNULL_BEGIN self.label.text = CommonStrings.retryButton; break; case ViewOnceMessageState_IncomingAvailable: - self.label.text = NSLocalizedString(@"PER_MESSAGE_EXPIRATION_TAP_TO_VIEW", - @"Label for view-once messages indicating that " - @"user can tap to view the message's contents."); + switch (self.viewOnceMessageType) { + case ViewOnceMessageType_Photo: + self.label.text = MessageStrings.viewOnceViewPhoto; + break; + case ViewOnceMessageType_Video: + self.label.text = MessageStrings.viewOnceViewVideo; + break; + case ViewOnceMessageType_Unknown: + OWSFailDebug(@"unexpected viewOnceMessageType for IncomingFailed."); + self.label.text = MessageStrings.viewOnceViewPhoto; + break; + } break; case ViewOnceMessageState_OutgoingFailed: self.label.text = CommonStrings.retryButton; diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 1dea3f0bf3..9b1d690a52 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -3529,13 +3529,20 @@ typedef enum : NSUInteger { [groupThread fireAvatarChangedNotification]; + NSData *_Nullable groupAvatarData; if (newGroupModel.groupImage) { - NSData *data = UIImagePNGRepresentation(newGroupModel.groupImage); - _Nullable id dataSource = [DataSourceValue dataSourceWithData:data fileExtension:@"png"]; + groupAvatarData = UIImagePNGRepresentation(newGroupModel.groupImage); + OWSAssertDebug(groupAvatarData.length > 0); + } + _Nullable id groupAvatarDataSource; + if (groupAvatarData.length > 0) { + groupAvatarDataSource = [DataSourceValue dataSourceWithData:groupAvatarData fileExtension:@"png"]; + } + if (groupAvatarDataSource != nil) { // DURABLE CLEANUP - currently one caller uses the completion handler to delete the tappable error message // which causes this code to be called. Once we're more aggressive about durable sending retry, // we could get rid of this "retryable tappable error message". - [self.messageSender sendTemporaryAttachment:dataSource + [self.messageSender sendTemporaryAttachment:groupAvatarDataSource contentType:OWSMimeTypeImagePng inMessage:message success:^{ diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m b/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m index 5477c172f6..6cbfc7623c 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m @@ -990,7 +990,8 @@ NSString *NSStringForViewOnceMessageState(ViewOnceMessageState cellType) return; } else if ([mediaAttachment isKindOfClass:[TSAttachmentStream class]]) { TSAttachmentStream *attachmentStream = (TSAttachmentStream *)mediaAttachment; - if (attachmentStream.isValidVisualMedia && (attachmentStream.isImage || attachmentStream.isAnimated)) { + if (attachmentStream.isValidVisualMedia + && (attachmentStream.isImage || attachmentStream.isAnimated || attachmentStream.isVideo)) { self.messageCellType = OWSMessageCellType_ViewOnce; self.viewOnceMessageState = ViewOnceMessageState_IncomingAvailable; self.attachmentStream = attachmentStream; diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m index c343288eb8..0ad28a7cd8 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m @@ -333,6 +333,10 @@ NS_ASSUME_NONNULL_BEGIN actionBlock:^{ [DebugUIMessages sendMessages:1 toAllMembersOfGroup:groupThread]; }]]; + [items addObject:[OWSTableItem itemWithTitle:@"Send Group Info Request" + actionBlock:^{ + [DebugUIMessages requestGroupInfoForGroupThread:groupThread]; + }]]; } return [OWSTableSection sectionWithTitle:self.name items:items]; @@ -4938,6 +4942,19 @@ typedef OWSContact * (^OWSContactBlock)(SDSAnyWriteTransaction *transaction); }]; } ++ (void)requestGroupInfoForGroupThread:(TSGroupThread *)groupThread +{ + [self writeWithBlock:^(SDSAnyWriteTransaction *_Nonnull transaction) { + for (SignalServiceAddress *address in groupThread.groupModel.groupMembers) { + TSThread *thread = [TSContactThread getOrCreateThreadWithContactAddress:address transaction:transaction]; + OWSLogInfo(@"Requesting group info for group thread from: %@", address); + OWSSyncGroupsRequestMessage *syncGroupsRequestMessage = + [[OWSSyncGroupsRequestMessage alloc] initWithThread:thread groupId:groupThread.groupModel.groupId]; + [self.messageSenderJobQueue addMessage:syncGroupsRequestMessage.asPreparer transaction:transaction]; + } + }]; +} + @end NS_ASSUME_NONNULL_END diff --git a/Signal/src/ViewControllers/ViewOnceMessageViewController.swift b/Signal/src/ViewControllers/ViewOnceMessageViewController.swift index 38992f4cc1..b17c29deae 100644 --- a/Signal/src/ViewControllers/ViewOnceMessageViewController.swift +++ b/Signal/src/ViewControllers/ViewOnceMessageViewController.swift @@ -9,19 +9,18 @@ import UIKit class ViewOnceMessageViewController: OWSViewController { class Content { + enum ContentType { + case stillImage, animatedImage, video + } + let messageId: String let filePath: String - // The content is an animated image (GIF or WEBP) - // if true, a still image otherwise. - // TODO: We could eventually support video. - let isAnimated: Bool + let type: ContentType - init(messageId: String, - filePath: String, - isAnimated: Bool) { + init(messageId: String, filePath: String, type: ContentType) { self.messageId = messageId self.filePath = filePath - self.isAnimated = isAnimated + self.type = type } deinit { @@ -132,11 +131,14 @@ class ViewOnceMessageViewController: OWSViewController { owsFailDebug("Missing content type.") return } - let isAnimated: Bool + + let viewOnceType: Content.ContentType if attachmentStream.isAnimated || contentType == OWSMimeTypeImageWebp { - isAnimated = true + viewOnceType = .animatedImage } else if attachmentStream.isImage { - isAnimated = false + viewOnceType = .stillImage + } else if attachmentStream.isVideo { + viewOnceType = .video } else { owsFailDebug("Unexpected content type.") return @@ -214,9 +216,7 @@ class ViewOnceMessageViewController: OWSViewController { return } - content = Content(messageId: messageId, - filePath: tempFilePath, - isAnimated: isAnimated) + content = Content(messageId: messageId, filePath: tempFilePath, type: viewOnceType) } return content } @@ -270,7 +270,8 @@ class ViewOnceMessageViewController: OWSViewController { private func buildMediaView() -> UIView? { let filePath = content.filePath - if content.isAnimated { + switch content.type { + case .animatedImage: guard let image = YYImage(contentsOfFile: filePath) else { owsFailDebug("Could not load attachment.") return nil @@ -291,7 +292,7 @@ class ViewOnceMessageViewController: OWSViewController { animatedImageView.layer.allowsEdgeAntialiasing = true animatedImageView.image = image return animatedImageView - } else { + case .stillImage: guard let image = UIImage(contentsOfFile: filePath) else { owsFailDebug("Could not load attachment.") return nil @@ -313,9 +314,66 @@ class ViewOnceMessageViewController: OWSViewController { imageView.layer.allowsEdgeAntialiasing = true imageView.image = image return imageView + case .video: + let videoContainer = UIView() + + let videoUrl = URL(fileURLWithPath: content.filePath) + let player = OWSVideoPlayer(url: videoUrl, shouldLoop: true) + self.videoPlayer = player + player.delegate = self + + let playerView = VideoPlayerView() + playerView.player = player.avPlayer + + videoContainer.addSubview(playerView) + playerView.autoPinEdgesToSuperviewEdges() + + let label = UILabel() + label.textColor = Theme.darkThemePrimaryColor + label.font = UIFont.ows_dynamicTypeBody.ows_monospaced() + label.setShadow() + + videoContainer.addSubview(label) + label.autoPinEdge(toSuperviewMargin: .top, withInset: 16) + label.autoPinEdge(toSuperviewMargin: .trailing, withInset: 16) + + let formatter = DateComponentsFormatter() + formatter.unitsStyle = .positional + formatter.allowedUnits = [.minute, .second ] + formatter.zeroFormattingBehavior = [ .pad ] + + let avPlayer = player.avPlayer + self.videoPlayerProgressObserver = avPlayer.addPeriodicTimeObserver(forInterval: CMTime(seconds: 0.1, preferredTimescale: 100), queue: nil) { [weak self] (_) in + + guard let item = avPlayer.currentItem else { + owsFailDebug("item was unexpectedly nil") + label.text = "0:00" + return + } + + let position = avPlayer.currentTime() + let duration: CMTime = item.asset.duration + let remainingTime = duration - position + let remainingSeconds = CMTimeGetSeconds(remainingTime) + + guard let remainingString = formatter.string(from: remainingSeconds) else { + owsFailDebug("unable to format time remaining") + label.text = "0:00" + return + } + + label.text = remainingString + } + + return videoContainer } } + // MARK: Video + + var videoPlayerProgressObserver: Any? + var videoPlayer: OWSVideoPlayer? + func setupDatabaseObservation() { databaseStorage.add(databaseStorageObserver: self) @@ -339,6 +397,7 @@ class ViewOnceMessageViewController: OWSViewController { super.viewDidAppear(animated) self.becomeFirstResponder() + self.videoPlayer?.play() } public override var preferredStatusBarStyle: UIStatusBarStyle { @@ -419,3 +478,9 @@ extension ViewOnceMessageViewController: SDSDatabaseStorageObserver { dismissIfRemoved() } } + +extension ViewOnceMessageViewController: OWSVideoPlayerDelegate { + func videoPlayerDidPlayToCompletion(_ videoPlayer: OWSVideoPlayer) { + // no-op + } +} diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index cd7ba46ac7..209b6ccbed 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -1773,10 +1773,13 @@ "PER_MESSAGE_EXPIRATION_NOTIFICATION" = "Disappearing Photo"; /* Label for outgoing view-once messages. */ -"PER_MESSAGE_EXPIRATION_OUTGOING_MESSAGE" = "Photo"; +"PER_MESSAGE_EXPIRATION_OUTGOING_MESSAGE" = "Media"; /* Label for view-once messages indicating that user can tap to view the message's contents. */ -"PER_MESSAGE_EXPIRATION_TAP_TO_VIEW" = "View Photo"; +"PER_MESSAGE_EXPIRATION_VIEW_PHOTO" = "View Photo"; + +/* Label for view-once messages indicating that user can tap to view the message's contents. */ +"PER_MESSAGE_EXPIRATION_VIEW_VIDEO" = "View Video"; /* Label for view-once messages indicating that the local user has viewed the message's contents. */ "PER_MESSAGE_EXPIRATION_VIEWED" = "Viewed"; diff --git a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift index 775b752807..507594ab35 100644 --- a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift +++ b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift @@ -69,11 +69,10 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC private var options: AttachmentApprovalViewControllerOptions { var options = receivedOptions - // For now, only still images can be sent as view-once messages. if FeatureFlags.viewOnceSending, attachmentApprovalItemCollection.attachmentApprovalItems.count == 1, let firstItem = attachmentApprovalItemCollection.attachmentApprovalItems.first, - firstItem.attachment.isValidImage { + firstItem.attachment.isValidImage || firstItem.attachment.isValidVideo { options.insert(.canToggleViewOnce) } diff --git a/SignalMessaging/Views/CommonStrings.swift b/SignalMessaging/Views/CommonStrings.swift index 192fe2f1aa..b172197a79 100644 --- a/SignalMessaging/Views/CommonStrings.swift +++ b/SignalMessaging/Views/CommonStrings.swift @@ -64,6 +64,12 @@ public class MessageStrings: NSObject { @objc static public let noteToSelf = NSLocalizedString("NOTE_TO_SELF", comment: "Label for 1:1 conversation with yourself.") + + @objc + static public let viewOnceViewPhoto = NSLocalizedString("PER_MESSAGE_EXPIRATION_VIEW_PHOTO", comment: "Label for view-once messages indicating that user can tap to view the message's contents.") + + @objc + static public let viewOnceViewVideo = NSLocalizedString("PER_MESSAGE_EXPIRATION_VIEW_VIDEO", comment: "Label for view-once messages indicating that user can tap to view the message's contents.") } @objc diff --git a/SignalMessaging/Views/VideoPlayerView.swift b/SignalMessaging/Views/VideoPlayerView.swift index 213c2fe396..ff4e5637b1 100644 --- a/SignalMessaging/Views/VideoPlayerView.swift +++ b/SignalMessaging/Views/VideoPlayerView.swift @@ -8,7 +8,7 @@ import AVFoundation @objc public class VideoPlayerView: UIView { @objc - var player: AVPlayer? { + public var player: AVPlayer? { get { return playerLayer.player } diff --git a/SignalMessaging/attachments/OWSVideoPlayer.swift b/SignalMessaging/attachments/OWSVideoPlayer.swift index 95532b2a70..361b005d7c 100644 --- a/SignalMessaging/attachments/OWSVideoPlayer.swift +++ b/SignalMessaging/attachments/OWSVideoPlayer.swift @@ -6,7 +6,7 @@ import Foundation import AVFoundation @objc -protocol OWSVideoPlayerDelegate: class { +public protocol OWSVideoPlayerDelegate: class { func videoPlayerDidPlayToCompletion(_ videoPlayer: OWSVideoPlayer) } @@ -14,15 +14,23 @@ protocol OWSVideoPlayerDelegate: class { public class OWSVideoPlayer: NSObject { @objc - let avPlayer: AVPlayer + public let avPlayer: AVPlayer let audioActivity: AudioActivity + let shouldLoop: Bool @objc - weak var delegate: OWSVideoPlayerDelegate? + weak public var delegate: OWSVideoPlayerDelegate? - @objc init(url: URL) { + @objc + convenience public init(url: URL) { + self.init(url: url, shouldLoop: false) + } + + @objc + public init(url: URL, shouldLoop: Bool) { self.avPlayer = AVPlayer(url: url) self.audioActivity = AudioActivity(audioDescription: "[OWSVideoPlayer] url:\(url)", behavior: .playback) + self.shouldLoop = shouldLoop super.init() @@ -81,6 +89,11 @@ public class OWSVideoPlayer: NSObject { @objc private func playerItemDidPlayToCompletion(_ notification: Notification) { self.delegate?.videoPlayerDidPlayToCompletion(self) - audioSession.endAudioActivity(self.audioActivity) + if shouldLoop { + avPlayer.seek(to: CMTime.zero) + avPlayer.play() + } else { + audioSession.endAudioActivity(self.audioActivity) + } } } diff --git a/SignalServiceKit/protobuf/SignalService.proto b/SignalServiceKit/protobuf/SignalService.proto index 42df452e9a..2965a8044f 100644 --- a/SignalServiceKit/protobuf/SignalService.proto +++ b/SignalServiceKit/protobuf/SignalService.proto @@ -228,7 +228,8 @@ message DataMessage { INITIAL = 0; MESSAGE_TIMERS = 1; VIEW_ONCE = 2; - CURRENT = 2; + VIEW_ONCE_VIDEO = 3; + CURRENT = 3; } optional string body = 1; diff --git a/SignalServiceKit/src/Devices/OWSBlockedPhoneNumbersMessage.m b/SignalServiceKit/src/Devices/OWSBlockedPhoneNumbersMessage.m index 0ef7d08ba0..78cd801526 100644 --- a/SignalServiceKit/src/Devices/OWSBlockedPhoneNumbersMessage.m +++ b/SignalServiceKit/src/Devices/OWSBlockedPhoneNumbersMessage.m @@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (nullable SSKProtoSyncMessageBuilder *)syncMessageBuilder +- (nullable SSKProtoSyncMessageBuilder *)syncMessageBuilderWithTransaction:(SDSAnyReadTransaction *)transaction { SSKProtoSyncMessageBlockedBuilder *blockedBuilder = [SSKProtoSyncMessageBlocked builder]; [blockedBuilder setNumbers:_phoneNumbers]; diff --git a/SignalServiceKit/src/Messages/DeviceSyncing/OWSOutgoingSentMessageTranscript.m b/SignalServiceKit/src/Messages/DeviceSyncing/OWSOutgoingSentMessageTranscript.m index bfb3b3a5c9..c0e2122e13 100644 --- a/SignalServiceKit/src/Messages/DeviceSyncing/OWSOutgoingSentMessageTranscript.m +++ b/SignalServiceKit/src/Messages/DeviceSyncing/OWSOutgoingSentMessageTranscript.m @@ -101,7 +101,7 @@ NS_ASSUME_NONNULL_BEGIN OWSAssertDebug(SSKFeatureFlags.viewOnceSending); [dataBuilder setIsViewOnce:YES]; - [dataBuilder setRequiredProtocolVersion:(uint32_t)SSKProtos.viewOnceMessagesProtocolVersion]; + [dataBuilder setRequiredProtocolVersion:(uint32_t)SSKProtoDataMessageProtocolVersionViewOnceVideo]; NSError *error; dataMessage = [dataBuilder buildAndReturnError:&error]; diff --git a/SignalServiceKit/src/Messages/Interactions/TSOutgoingMessage.m b/SignalServiceKit/src/Messages/Interactions/TSOutgoingMessage.m index 25d8cf2a8c..efffdafed9 100644 --- a/SignalServiceKit/src/Messages/Interactions/TSOutgoingMessage.m +++ b/SignalServiceKit/src/Messages/Interactions/TSOutgoingMessage.m @@ -1069,13 +1069,13 @@ NSUInteger const TSOutgoingMessageSchemaVersion = 1; SSKProtoDataMessageBuilder *builder = [SSKProtoDataMessage builder]; [builder setTimestamp:self.timestamp]; - - NSUInteger requiredProtocolVersion = SSKProtos.initialProtocolVersion; + + NSUInteger requiredProtocolVersion = SSKProtoDataMessageProtocolVersionInitial; if (self.isViewOnceMessage) { if (SSKFeatureFlags.viewOnceSending) { [builder setIsViewOnce:YES]; - requiredProtocolVersion = SSKProtos.viewOnceMessagesProtocolVersion; + requiredProtocolVersion = SSKProtoDataMessageProtocolVersionViewOnceVideo; } else { OWSFailDebug(@"Feature flag not set."); } diff --git a/SignalServiceKit/src/Messages/OWSMessageManager.m b/SignalServiceKit/src/Messages/OWSMessageManager.m index d91570158c..15c3d880ee 100644 --- a/SignalServiceKit/src/Messages/OWSMessageManager.m +++ b/SignalServiceKit/src/Messages/OWSMessageManager.m @@ -1256,19 +1256,23 @@ NS_ASSUME_NONNULL_BEGIN // Only send this group update to the requester. [message updateWithSendingToSingleGroupRecipient:envelope.sourceAddress transaction:transaction]; + NSData *_Nullable groupAvatarData; if (gThread.groupModel.groupImage) { - NSData *_Nullable data = UIImagePNGRepresentation(gThread.groupModel.groupImage); - OWSAssertDebug(data); - if (data) { - _Nullable id dataSource = [DataSourceValue dataSourceWithData:data fileExtension:@"png"]; - [self.messageSenderJobQueue addMediaMessage:message - dataSource:dataSource - contentType:OWSMimeTypeImagePng - sourceFilename:nil - caption:nil - albumMessageId:nil - isTemporaryAttachment:YES]; - } + groupAvatarData = UIImagePNGRepresentation(gThread.groupModel.groupImage); + OWSAssertDebug(groupAvatarData.length > 0); + } + _Nullable id groupAvatarDataSource; + if (groupAvatarData.length > 0) { + groupAvatarDataSource = [DataSourceValue dataSourceWithData:groupAvatarData fileExtension:@"png"]; + } + if (groupAvatarDataSource != nil) { + [self.messageSenderJobQueue addMediaMessage:message + dataSource:groupAvatarDataSource + contentType:OWSMimeTypeImagePng + sourceFilename:nil + caption:nil + albumMessageId:nil + isTemporaryAttachment:YES]; } else { [self.messageSenderJobQueue addMessage:message.asPreparer transaction:transaction]; } diff --git a/SignalServiceKit/src/Protos/Generated/SSKProto.swift b/SignalServiceKit/src/Protos/Generated/SSKProto.swift index 8f94b6c046..5b7f7dde52 100644 --- a/SignalServiceKit/src/Protos/Generated/SSKProto.swift +++ b/SignalServiceKit/src/Protos/Generated/SSKProto.swift @@ -713,32 +713,32 @@ extension SSKProtoTypingMessage.SSKProtoTypingMessageBuilder { } fileprivate class func parseProto(_ proto: SignalServiceProtos_Content) throws -> SSKProtoContent { - var dataMessage: SSKProtoDataMessage? = nil + var dataMessage: SSKProtoDataMessage? if proto.hasDataMessage { dataMessage = try SSKProtoDataMessage.parseProto(proto.dataMessage) } - var syncMessage: SSKProtoSyncMessage? = nil + var syncMessage: SSKProtoSyncMessage? if proto.hasSyncMessage { syncMessage = try SSKProtoSyncMessage.parseProto(proto.syncMessage) } - var callMessage: SSKProtoCallMessage? = nil + var callMessage: SSKProtoCallMessage? if proto.hasCallMessage { callMessage = try SSKProtoCallMessage.parseProto(proto.callMessage) } - var nullMessage: SSKProtoNullMessage? = nil + var nullMessage: SSKProtoNullMessage? if proto.hasNullMessage { nullMessage = try SSKProtoNullMessage.parseProto(proto.nullMessage) } - var receiptMessage: SSKProtoReceiptMessage? = nil + var receiptMessage: SSKProtoReceiptMessage? if proto.hasReceiptMessage { receiptMessage = try SSKProtoReceiptMessage.parseProto(proto.receiptMessage) } - var typingMessage: SSKProtoTypingMessage? = nil + var typingMessage: SSKProtoTypingMessage? if proto.hasTypingMessage { typingMessage = try SSKProtoTypingMessage.parseProto(proto.typingMessage) } @@ -1531,12 +1531,12 @@ extension SSKProtoCallMessageHangup.SSKProtoCallMessageHangupBuilder { } fileprivate class func parseProto(_ proto: SignalServiceProtos_CallMessage) throws -> SSKProtoCallMessage { - var offer: SSKProtoCallMessageOffer? = nil + var offer: SSKProtoCallMessageOffer? if proto.hasOffer { offer = try SSKProtoCallMessageOffer.parseProto(proto.offer) } - var answer: SSKProtoCallMessageAnswer? = nil + var answer: SSKProtoCallMessageAnswer? if proto.hasAnswer { answer = try SSKProtoCallMessageAnswer.parseProto(proto.answer) } @@ -1544,12 +1544,12 @@ extension SSKProtoCallMessageHangup.SSKProtoCallMessageHangupBuilder { var iceUpdate: [SSKProtoCallMessageIceUpdate] = [] iceUpdate = try proto.iceUpdate.map { try SSKProtoCallMessageIceUpdate.parseProto($0) } - var hangup: SSKProtoCallMessageHangup? = nil + var hangup: SSKProtoCallMessageHangup? if proto.hasHangup { hangup = try SSKProtoCallMessageHangup.parseProto(proto.hangup) } - var busy: SSKProtoCallMessageBusy? = nil + var busy: SSKProtoCallMessageBusy? if proto.hasBusy { busy = try SSKProtoCallMessageBusy.parseProto(proto.busy) } @@ -1735,7 +1735,7 @@ extension SSKProtoCallMessage.SSKProtoCallMessageBuilder { } fileprivate class func parseProto(_ proto: SignalServiceProtos_DataMessage.Quote.QuotedAttachment) throws -> SSKProtoDataMessageQuoteQuotedAttachment { - var thumbnail: SSKProtoAttachmentPointer? = nil + var thumbnail: SSKProtoAttachmentPointer? if proto.hasThumbnail { thumbnail = try SSKProtoAttachmentPointer.parseProto(proto.thumbnail) } @@ -2982,7 +2982,7 @@ extension SSKProtoDataMessageContactPostalAddress.SSKProtoDataMessageContactPost } fileprivate class func parseProto(_ proto: SignalServiceProtos_DataMessage.Contact.Avatar) throws -> SSKProtoDataMessageContactAvatar { - var avatar: SSKProtoAttachmentPointer? = nil + var avatar: SSKProtoAttachmentPointer? if proto.hasAvatar { avatar = try SSKProtoAttachmentPointer.parseProto(proto.avatar) } @@ -3170,7 +3170,7 @@ extension SSKProtoDataMessageContactAvatar.SSKProtoDataMessageContactAvatarBuild } fileprivate class func parseProto(_ proto: SignalServiceProtos_DataMessage.Contact) throws -> SSKProtoDataMessageContact { - var name: SSKProtoDataMessageContactName? = nil + var name: SSKProtoDataMessageContactName? if proto.hasName { name = try SSKProtoDataMessageContactName.parseProto(proto.name) } @@ -3184,7 +3184,7 @@ extension SSKProtoDataMessageContactAvatar.SSKProtoDataMessageContactAvatarBuild var address: [SSKProtoDataMessageContactPostalAddress] = [] address = try proto.address.map { try SSKProtoDataMessageContactPostalAddress.parseProto($0) } - var avatar: SSKProtoDataMessageContactAvatar? = nil + var avatar: SSKProtoDataMessageContactAvatar? if proto.hasAvatar { avatar = try SSKProtoDataMessageContactAvatar.parseProto(proto.avatar) } @@ -3339,7 +3339,7 @@ extension SSKProtoDataMessageContact.SSKProtoDataMessageContactBuilder { } let url = proto.url - var image: SSKProtoAttachmentPointer? = nil + var image: SSKProtoAttachmentPointer? if proto.hasImage { image = try SSKProtoAttachmentPointer.parseProto(proto.image) } @@ -3573,6 +3573,7 @@ extension SSKProtoDataMessageSticker.SSKProtoDataMessageStickerBuilder { case initial = 0 case messageTimers = 1 case viewOnce = 2 + case viewOnceVideo = 3 } private class func SSKProtoDataMessageProtocolVersionWrap(_ value: SignalServiceProtos_DataMessage.ProtocolVersion) -> SSKProtoDataMessageProtocolVersion { @@ -3580,6 +3581,7 @@ extension SSKProtoDataMessageSticker.SSKProtoDataMessageStickerBuilder { case .initial: return .initial case .messageTimers: return .messageTimers case .viewOnce: return .viewOnce + case .viewOnceVideo: return .viewOnceVideo } } @@ -3588,6 +3590,7 @@ extension SSKProtoDataMessageSticker.SSKProtoDataMessageStickerBuilder { case .initial: return .initial case .messageTimers: return .messageTimers case .viewOnce: return .viewOnce + case .viewOnceVideo: return .viewOnceVideo } } @@ -3860,12 +3863,12 @@ extension SSKProtoDataMessageSticker.SSKProtoDataMessageStickerBuilder { var attachments: [SSKProtoAttachmentPointer] = [] attachments = try proto.attachments.map { try SSKProtoAttachmentPointer.parseProto($0) } - var group: SSKProtoGroupContext? = nil + var group: SSKProtoGroupContext? if proto.hasGroup { group = try SSKProtoGroupContext.parseProto(proto.group) } - var quote: SSKProtoDataMessageQuote? = nil + var quote: SSKProtoDataMessageQuote? if proto.hasQuote { quote = try SSKProtoDataMessageQuote.parseProto(proto.quote) } @@ -3876,7 +3879,7 @@ extension SSKProtoDataMessageSticker.SSKProtoDataMessageStickerBuilder { var preview: [SSKProtoDataMessagePreview] = [] preview = try proto.preview.map { try SSKProtoDataMessagePreview.parseProto($0) } - var sticker: SSKProtoDataMessageSticker? = nil + var sticker: SSKProtoDataMessageSticker? if proto.hasSticker { sticker = try SSKProtoDataMessageSticker.parseProto(proto.sticker) } @@ -4831,7 +4834,7 @@ extension SSKProtoSyncMessageSentUnidentifiedDeliveryStatus.SSKProtoSyncMessageS } fileprivate class func parseProto(_ proto: SignalServiceProtos_SyncMessage.Sent) throws -> SSKProtoSyncMessageSent { - var message: SSKProtoDataMessage? = nil + var message: SSKProtoDataMessage? if proto.hasMessage { message = try SSKProtoDataMessage.parseProto(proto.message) } @@ -5055,7 +5058,7 @@ extension SSKProtoSyncMessageContacts.SSKProtoSyncMessageContactsBuilder { } fileprivate class func parseProto(_ proto: SignalServiceProtos_SyncMessage.Groups) throws -> SSKProtoSyncMessageGroups { - var blob: SSKProtoAttachmentPointer? = nil + var blob: SSKProtoAttachmentPointer? if proto.hasBlob { blob = try SSKProtoAttachmentPointer.parseProto(proto.blob) } @@ -6285,22 +6288,22 @@ extension SSKProtoSyncMessageViewOnceOpen.SSKProtoSyncMessageViewOnceOpenBuilder } fileprivate class func parseProto(_ proto: SignalServiceProtos_SyncMessage) throws -> SSKProtoSyncMessage { - var sent: SSKProtoSyncMessageSent? = nil + var sent: SSKProtoSyncMessageSent? if proto.hasSent { sent = try SSKProtoSyncMessageSent.parseProto(proto.sent) } - var contacts: SSKProtoSyncMessageContacts? = nil + var contacts: SSKProtoSyncMessageContacts? if proto.hasContacts { contacts = try SSKProtoSyncMessageContacts.parseProto(proto.contacts) } - var groups: SSKProtoSyncMessageGroups? = nil + var groups: SSKProtoSyncMessageGroups? if proto.hasGroups { groups = try SSKProtoSyncMessageGroups.parseProto(proto.groups) } - var request: SSKProtoSyncMessageRequest? = nil + var request: SSKProtoSyncMessageRequest? if proto.hasRequest { request = try SSKProtoSyncMessageRequest.parseProto(proto.request) } @@ -6308,17 +6311,17 @@ extension SSKProtoSyncMessageViewOnceOpen.SSKProtoSyncMessageViewOnceOpenBuilder var read: [SSKProtoSyncMessageRead] = [] read = try proto.read.map { try SSKProtoSyncMessageRead.parseProto($0) } - var blocked: SSKProtoSyncMessageBlocked? = nil + var blocked: SSKProtoSyncMessageBlocked? if proto.hasBlocked { blocked = try SSKProtoSyncMessageBlocked.parseProto(proto.blocked) } - var verified: SSKProtoVerified? = nil + var verified: SSKProtoVerified? if proto.hasVerified { verified = try SSKProtoVerified.parseProto(proto.verified) } - var configuration: SSKProtoSyncMessageConfiguration? = nil + var configuration: SSKProtoSyncMessageConfiguration? if proto.hasConfiguration { configuration = try SSKProtoSyncMessageConfiguration.parseProto(proto.configuration) } @@ -6326,7 +6329,7 @@ extension SSKProtoSyncMessageViewOnceOpen.SSKProtoSyncMessageViewOnceOpenBuilder var stickerPackOperation: [SSKProtoSyncMessageStickerPackOperation] = [] stickerPackOperation = try proto.stickerPackOperation.map { try SSKProtoSyncMessageStickerPackOperation.parseProto($0) } - var viewOnceOpen: SSKProtoSyncMessageViewOnceOpen? = nil + var viewOnceOpen: SSKProtoSyncMessageViewOnceOpen? if proto.hasViewOnceOpen { viewOnceOpen = try SSKProtoSyncMessageViewOnceOpen.parseProto(proto.viewOnceOpen) } @@ -7017,7 +7020,7 @@ extension SSKProtoGroupContextMember.SSKProtoGroupContextMemberBuilder { } let id = proto.id - var avatar: SSKProtoAttachmentPointer? = nil + var avatar: SSKProtoAttachmentPointer? if proto.hasAvatar { avatar = try SSKProtoAttachmentPointer.parseProto(proto.avatar) } @@ -7407,12 +7410,12 @@ extension SSKProtoContactDetailsAvatar.SSKProtoContactDetailsAvatarBuilder { } fileprivate class func parseProto(_ proto: SignalServiceProtos_ContactDetails) throws -> SSKProtoContactDetails { - var avatar: SSKProtoContactDetailsAvatar? = nil + var avatar: SSKProtoContactDetailsAvatar? if proto.hasAvatar { avatar = try SSKProtoContactDetailsAvatar.parseProto(proto.avatar) } - var verified: SSKProtoVerified? = nil + var verified: SSKProtoVerified? if proto.hasVerified { verified = try SSKProtoVerified.parseProto(proto.verified) } @@ -7904,7 +7907,7 @@ extension SSKProtoGroupDetailsMember.SSKProtoGroupDetailsMemberBuilder { } let id = proto.id - var avatar: SSKProtoGroupDetailsAvatar? = nil + var avatar: SSKProtoGroupDetailsAvatar? if proto.hasAvatar { avatar = try SSKProtoGroupDetailsAvatar.parseProto(proto.avatar) } @@ -8195,7 +8198,7 @@ extension SSKProtoPackSticker.SSKProtoPackStickerBuilder { } fileprivate class func parseProto(_ proto: SignalServiceProtos_Pack) throws -> SSKProtoPack { - var cover: SSKProtoPackSticker? = nil + var cover: SSKProtoPackSticker? if proto.hasCover { cover = try SSKProtoPackSticker.parseProto(proto.cover) } diff --git a/SignalServiceKit/src/Protos/Generated/SSKProtos.swift b/SignalServiceKit/src/Protos/Generated/SSKProtos.swift index f77d810f96..5c9f973d8c 100644 --- a/SignalServiceKit/src/Protos/Generated/SSKProtos.swift +++ b/SignalServiceKit/src/Protos/Generated/SSKProtos.swift @@ -9,23 +9,10 @@ public class SSKProtos: NSObject { private override init() {} - @objc - public class var initialProtocolVersion: Int { - return SignalServiceProtos_DataMessage.ProtocolVersion.initial.rawValue - } - - @objc - public class var perMessageExpirationProtocolVersion: Int { - return SignalServiceProtos_DataMessage.ProtocolVersion.messageTimers.rawValue - } - - @objc - public class var viewOnceMessagesProtocolVersion: Int { - return SignalServiceProtos_DataMessage.ProtocolVersion.viewOnce.rawValue - } - @objc public class var currentProtocolVersion: Int { + // Our proto wrappers don't handle enum aliases, so we have one non-generated + // wrapper for the "current" protocol version. return SignalServiceProtos_DataMessage.ProtocolVersion.current.rawValue } } diff --git a/SignalServiceKit/src/Protos/Generated/SignalService.pb.swift b/SignalServiceKit/src/Protos/Generated/SignalService.pb.swift index 76b286ec0b..ff2387e31d 100644 --- a/SignalServiceKit/src/Protos/Generated/SignalService.pb.swift +++ b/SignalServiceKit/src/Protos/Generated/SignalService.pb.swift @@ -1,10 +1,6 @@ -// DO NOT EDIT. // -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: SignalService.proto +// Copyright (c) 2019 Open Whisper Systems. All rights reserved. // -// For information on using the generated types, please see the documenation: -// https://github.com/apple/swift-protobuf/ //* // Copyright (C) 2014-2016 Open Whisper Systems @@ -22,7 +18,7 @@ import SwiftProtobuf // incompatible with the version of SwiftProtobuf to which you are linking. // Please ensure that your are building against the same version of the API // that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { +private struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } @@ -169,16 +165,16 @@ struct SignalServiceProtos_Envelope { init() {} - fileprivate var _type: SignalServiceProtos_Envelope.TypeEnum? = nil - fileprivate var _sourceE164: String? = nil - fileprivate var _sourceDevice: UInt32? = nil - fileprivate var _relay: String? = nil - fileprivate var _timestamp: UInt64? = nil - fileprivate var _legacyMessage: Data? = nil - fileprivate var _content: Data? = nil - fileprivate var _serverGuid: String? = nil - fileprivate var _serverTimestamp: UInt64? = nil - fileprivate var _sourceUuid: String? = nil + fileprivate var _type: SignalServiceProtos_Envelope.TypeEnum? + fileprivate var _sourceE164: String? + fileprivate var _sourceDevice: UInt32? + fileprivate var _relay: String? + fileprivate var _timestamp: UInt64? + fileprivate var _legacyMessage: Data? + fileprivate var _content: Data? + fileprivate var _serverGuid: String? + fileprivate var _serverTimestamp: UInt64? + fileprivate var _sourceUuid: String? } #if swift(>=4.2) @@ -252,9 +248,9 @@ struct SignalServiceProtos_TypingMessage { init() {} - fileprivate var _timestamp: UInt64? = nil - fileprivate var _action: SignalServiceProtos_TypingMessage.Action? = nil - fileprivate var _groupID: Data? = nil + fileprivate var _timestamp: UInt64? + fileprivate var _action: SignalServiceProtos_TypingMessage.Action? + fileprivate var _groupID: Data? } #if swift(>=4.2) @@ -421,8 +417,8 @@ struct SignalServiceProtos_CallMessage { init() {} - fileprivate var _id: UInt64? = nil - fileprivate var _sessionDescription: String? = nil + fileprivate var _id: UInt64? + fileprivate var _sessionDescription: String? } struct Answer { @@ -456,8 +452,8 @@ struct SignalServiceProtos_CallMessage { init() {} - fileprivate var _id: UInt64? = nil - fileprivate var _sessionDescription: String? = nil + fileprivate var _id: UInt64? + fileprivate var _sessionDescription: String? } struct IceUpdate { @@ -509,10 +505,10 @@ struct SignalServiceProtos_CallMessage { init() {} - fileprivate var _id: UInt64? = nil - fileprivate var _sdpMid: String? = nil - fileprivate var _sdpMlineIndex: UInt32? = nil - fileprivate var _sdp: String? = nil + fileprivate var _id: UInt64? + fileprivate var _sdpMid: String? + fileprivate var _sdpMlineIndex: UInt32? + fileprivate var _sdp: String? } struct Busy { @@ -534,7 +530,7 @@ struct SignalServiceProtos_CallMessage { init() {} - fileprivate var _id: UInt64? = nil + fileprivate var _id: UInt64? } struct Hangup { @@ -556,7 +552,7 @@ struct SignalServiceProtos_CallMessage { init() {} - fileprivate var _id: UInt64? = nil + fileprivate var _id: UInt64? } init() {} @@ -710,7 +706,8 @@ struct SignalServiceProtos_DataMessage { case initial // = 0 case messageTimers // = 1 case viewOnce // = 2 - static let current = viewOnce + case viewOnceVideo // = 3 + static let current = viewOnceVideo init() { self = .initial @@ -721,6 +718,7 @@ struct SignalServiceProtos_DataMessage { case 0: self = .initial case 1: self = .messageTimers case 2: self = .viewOnce + case 3: self = .viewOnceVideo default: return nil } } @@ -730,6 +728,7 @@ struct SignalServiceProtos_DataMessage { case .initial: return 0 case .messageTimers: return 1 case .viewOnce: return 2 + case .viewOnceVideo: return 3 } } @@ -854,10 +853,10 @@ struct SignalServiceProtos_DataMessage { init() {} - fileprivate var _id: UInt64? = nil - fileprivate var _authorE164: String? = nil - fileprivate var _authorUuid: String? = nil - fileprivate var _text: String? = nil + fileprivate var _id: UInt64? + fileprivate var _authorE164: String? + fileprivate var _authorUuid: String? + fileprivate var _text: String? } struct Contact { @@ -972,12 +971,12 @@ struct SignalServiceProtos_DataMessage { init() {} - fileprivate var _givenName: String? = nil - fileprivate var _familyName: String? = nil - fileprivate var _prefix: String? = nil - fileprivate var _suffix: String? = nil - fileprivate var _middleName: String? = nil - fileprivate var _displayName: String? = nil + fileprivate var _givenName: String? + fileprivate var _familyName: String? + fileprivate var _prefix: String? + fileprivate var _suffix: String? + fileprivate var _middleName: String? + fileprivate var _displayName: String? } struct Phone { @@ -1048,9 +1047,9 @@ struct SignalServiceProtos_DataMessage { init() {} - fileprivate var _value: String? = nil - fileprivate var _type: SignalServiceProtos_DataMessage.Contact.Phone.TypeEnum? = nil - fileprivate var _label: String? = nil + fileprivate var _value: String? + fileprivate var _type: SignalServiceProtos_DataMessage.Contact.Phone.TypeEnum? + fileprivate var _label: String? } struct Email { @@ -1121,9 +1120,9 @@ struct SignalServiceProtos_DataMessage { init() {} - fileprivate var _value: String? = nil - fileprivate var _type: SignalServiceProtos_DataMessage.Contact.Email.TypeEnum? = nil - fileprivate var _label: String? = nil + fileprivate var _value: String? + fileprivate var _type: SignalServiceProtos_DataMessage.Contact.Email.TypeEnum? + fileprivate var _label: String? } struct PostalAddress { @@ -1245,15 +1244,15 @@ struct SignalServiceProtos_DataMessage { init() {} - fileprivate var _type: SignalServiceProtos_DataMessage.Contact.PostalAddress.TypeEnum? = nil - fileprivate var _label: String? = nil - fileprivate var _street: String? = nil - fileprivate var _pobox: String? = nil - fileprivate var _neighborhood: String? = nil - fileprivate var _city: String? = nil - fileprivate var _region: String? = nil - fileprivate var _postcode: String? = nil - fileprivate var _country: String? = nil + fileprivate var _type: SignalServiceProtos_DataMessage.Contact.PostalAddress.TypeEnum? + fileprivate var _label: String? + fileprivate var _street: String? + fileprivate var _pobox: String? + fileprivate var _neighborhood: String? + fileprivate var _city: String? + fileprivate var _region: String? + fileprivate var _postcode: String? + fileprivate var _country: String? } struct Avatar { @@ -1418,7 +1417,7 @@ struct SignalServiceProtos_NullMessage { init() {} - fileprivate var _padding: Data? = nil + fileprivate var _padding: Data? } struct SignalServiceProtos_ReceiptMessage { @@ -1467,7 +1466,7 @@ struct SignalServiceProtos_ReceiptMessage { init() {} - fileprivate var _type: SignalServiceProtos_ReceiptMessage.TypeEnum? = nil + fileprivate var _type: SignalServiceProtos_ReceiptMessage.TypeEnum? } #if swift(>=4.2) @@ -1561,11 +1560,11 @@ struct SignalServiceProtos_Verified { init() {} - fileprivate var _destinationE164: String? = nil - fileprivate var _destinationUuid: String? = nil - fileprivate var _identityKey: Data? = nil - fileprivate var _state: SignalServiceProtos_Verified.State? = nil - fileprivate var _nullMessage: Data? = nil + fileprivate var _destinationE164: String? + fileprivate var _destinationUuid: String? + fileprivate var _identityKey: Data? + fileprivate var _state: SignalServiceProtos_Verified.State? + fileprivate var _nullMessage: Data? } #if swift(>=4.2) @@ -1776,9 +1775,9 @@ struct SignalServiceProtos_SyncMessage { init() {} - fileprivate var _destinationE164: String? = nil - fileprivate var _destinationUuid: String? = nil - fileprivate var _unidentified: Bool? = nil + fileprivate var _destinationE164: String? + fileprivate var _destinationUuid: String? + fileprivate var _unidentified: Bool? } init() {} @@ -1908,7 +1907,7 @@ struct SignalServiceProtos_SyncMessage { init() {} - fileprivate var _type: SignalServiceProtos_SyncMessage.Request.TypeEnum? = nil + fileprivate var _type: SignalServiceProtos_SyncMessage.Request.TypeEnum? } struct Read { @@ -1948,9 +1947,9 @@ struct SignalServiceProtos_SyncMessage { init() {} - fileprivate var _senderE164: String? = nil - fileprivate var _senderUuid: String? = nil - fileprivate var _timestamp: UInt64? = nil + fileprivate var _senderE164: String? + fileprivate var _senderUuid: String? + fileprivate var _timestamp: UInt64? } struct Configuration { @@ -1998,10 +1997,10 @@ struct SignalServiceProtos_SyncMessage { init() {} - fileprivate var _readReceipts: Bool? = nil - fileprivate var _unidentifiedDeliveryIndicators: Bool? = nil - fileprivate var _typingIndicators: Bool? = nil - fileprivate var _linkPreviews: Bool? = nil + fileprivate var _readReceipts: Bool? + fileprivate var _unidentifiedDeliveryIndicators: Bool? + fileprivate var _typingIndicators: Bool? + fileprivate var _linkPreviews: Bool? } struct StickerPackOperation { @@ -2068,9 +2067,9 @@ struct SignalServiceProtos_SyncMessage { init() {} - fileprivate var _packID: Data? = nil - fileprivate var _packKey: Data? = nil - fileprivate var _type: SignalServiceProtos_SyncMessage.StickerPackOperation.TypeEnum? = nil + fileprivate var _packID: Data? + fileprivate var _packKey: Data? + fileprivate var _type: SignalServiceProtos_SyncMessage.StickerPackOperation.TypeEnum? } struct ViewOnceOpen { @@ -2110,9 +2109,9 @@ struct SignalServiceProtos_SyncMessage { init() {} - fileprivate var _senderE164: String? = nil - fileprivate var _senderUuid: String? = nil - fileprivate var _timestamp: UInt64? = nil + fileprivate var _senderE164: String? + fileprivate var _senderUuid: String? + fileprivate var _timestamp: UInt64? } init() {} @@ -2252,17 +2251,17 @@ struct SignalServiceProtos_AttachmentPointer { init() {} - fileprivate var _id: UInt64? = nil - fileprivate var _contentType: String? = nil - fileprivate var _key: Data? = nil - fileprivate var _size: UInt32? = nil - fileprivate var _thumbnail: Data? = nil - fileprivate var _digest: Data? = nil - fileprivate var _fileName: String? = nil - fileprivate var _flags: UInt32? = nil - fileprivate var _width: UInt32? = nil - fileprivate var _height: UInt32? = nil - fileprivate var _caption: String? = nil + fileprivate var _id: UInt64? + fileprivate var _contentType: String? + fileprivate var _key: Data? + fileprivate var _size: UInt32? + fileprivate var _thumbnail: Data? + fileprivate var _digest: Data? + fileprivate var _fileName: String? + fileprivate var _flags: UInt32? + fileprivate var _width: UInt32? + fileprivate var _height: UInt32? + fileprivate var _caption: String? } #if swift(>=4.2) @@ -2392,8 +2391,8 @@ struct SignalServiceProtos_GroupContext { init() {} - fileprivate var _uuid: String? = nil - fileprivate var _e164: String? = nil + fileprivate var _uuid: String? + fileprivate var _e164: String? } init() {} @@ -2524,8 +2523,8 @@ struct SignalServiceProtos_ContactDetails { init() {} - fileprivate var _contentType: String? = nil - fileprivate var _length: UInt32? = nil + fileprivate var _contentType: String? + fileprivate var _length: UInt32? } init() {} @@ -2644,8 +2643,8 @@ struct SignalServiceProtos_GroupDetails { init() {} - fileprivate var _contentType: String? = nil - fileprivate var _length: UInt32? = nil + fileprivate var _contentType: String? + fileprivate var _length: UInt32? } struct Member { @@ -2675,8 +2674,8 @@ struct SignalServiceProtos_GroupDetails { init() {} - fileprivate var _uuid: String? = nil - fileprivate var _e164: String? = nil + fileprivate var _uuid: String? + fileprivate var _e164: String? } init() {} @@ -2751,8 +2750,8 @@ struct SignalServiceProtos_Pack { init() {} - fileprivate var _id: UInt32? = nil - fileprivate var _emoji: String? = nil + fileprivate var _id: UInt32? + fileprivate var _emoji: String? } init() {} @@ -2762,7 +2761,7 @@ struct SignalServiceProtos_Pack { // MARK: - Code below here is support for the SwiftProtobuf runtime. -fileprivate let _protobuf_package = "SignalServiceProtos" +private let _protobuf_package = "SignalServiceProtos" extension SignalServiceProtos_Envelope: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Envelope" @@ -2776,7 +2775,7 @@ extension SignalServiceProtos_Envelope: SwiftProtobuf.Message, SwiftProtobuf._Me 8: .same(proto: "content"), 9: .same(proto: "serverGuid"), 10: .same(proto: "serverTimestamp"), - 11: .same(proto: "sourceUuid"), + 11: .same(proto: "sourceUuid") ] mutating func decodeMessage(decoder: inout D) throws { @@ -2854,7 +2853,7 @@ extension SignalServiceProtos_Envelope.TypeEnum: SwiftProtobuf._ProtoNameProvidi 2: .same(proto: "KEY_EXCHANGE"), 3: .same(proto: "PREKEY_BUNDLE"), 5: .same(proto: "RECEIPT"), - 6: .same(proto: "UNIDENTIFIED_SENDER"), + 6: .same(proto: "UNIDENTIFIED_SENDER") ] } @@ -2863,7 +2862,7 @@ extension SignalServiceProtos_TypingMessage: SwiftProtobuf.Message, SwiftProtobu static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "timestamp"), 2: .same(proto: "action"), - 3: .same(proto: "groupId"), + 3: .same(proto: "groupId") ] mutating func decodeMessage(decoder: inout D) throws { @@ -2902,7 +2901,7 @@ extension SignalServiceProtos_TypingMessage: SwiftProtobuf.Message, SwiftProtobu extension SignalServiceProtos_TypingMessage.Action: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 0: .same(proto: "STARTED"), - 1: .same(proto: "STOPPED"), + 1: .same(proto: "STOPPED") ] } @@ -2914,16 +2913,16 @@ extension SignalServiceProtos_Content: SwiftProtobuf.Message, SwiftProtobuf._Mes 3: .same(proto: "callMessage"), 4: .same(proto: "nullMessage"), 5: .same(proto: "receiptMessage"), - 6: .same(proto: "typingMessage"), + 6: .same(proto: "typingMessage") ] fileprivate class _StorageClass { - var _dataMessage: SignalServiceProtos_DataMessage? = nil - var _syncMessage: SignalServiceProtos_SyncMessage? = nil - var _callMessage: SignalServiceProtos_CallMessage? = nil - var _nullMessage: SignalServiceProtos_NullMessage? = nil - var _receiptMessage: SignalServiceProtos_ReceiptMessage? = nil - var _typingMessage: SignalServiceProtos_TypingMessage? = nil + var _dataMessage: SignalServiceProtos_DataMessage? + var _syncMessage: SignalServiceProtos_SyncMessage? + var _callMessage: SignalServiceProtos_CallMessage? + var _nullMessage: SignalServiceProtos_NullMessage? + var _receiptMessage: SignalServiceProtos_ReceiptMessage? + var _typingMessage: SignalServiceProtos_TypingMessage? static let defaultInstance = _StorageClass() @@ -3015,16 +3014,16 @@ extension SignalServiceProtos_CallMessage: SwiftProtobuf.Message, SwiftProtobuf. 3: .same(proto: "iceUpdate"), 4: .same(proto: "hangup"), 5: .same(proto: "busy"), - 6: .same(proto: "profileKey"), + 6: .same(proto: "profileKey") ] fileprivate class _StorageClass { - var _offer: SignalServiceProtos_CallMessage.Offer? = nil - var _answer: SignalServiceProtos_CallMessage.Answer? = nil + var _offer: SignalServiceProtos_CallMessage.Offer? + var _answer: SignalServiceProtos_CallMessage.Answer? var _iceUpdate: [SignalServiceProtos_CallMessage.IceUpdate] = [] - var _hangup: SignalServiceProtos_CallMessage.Hangup? = nil - var _busy: SignalServiceProtos_CallMessage.Busy? = nil - var _profileKey: Data? = nil + var _hangup: SignalServiceProtos_CallMessage.Hangup? + var _busy: SignalServiceProtos_CallMessage.Busy? + var _profileKey: Data? static let defaultInstance = _StorageClass() @@ -3112,7 +3111,7 @@ extension SignalServiceProtos_CallMessage.Offer: SwiftProtobuf.Message, SwiftPro static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Offer" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "id"), - 2: .same(proto: "sessionDescription"), + 2: .same(proto: "sessionDescription") ] mutating func decodeMessage(decoder: inout D) throws { @@ -3147,7 +3146,7 @@ extension SignalServiceProtos_CallMessage.Answer: SwiftProtobuf.Message, SwiftPr static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Answer" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "id"), - 2: .same(proto: "sessionDescription"), + 2: .same(proto: "sessionDescription") ] mutating func decodeMessage(decoder: inout D) throws { @@ -3184,7 +3183,7 @@ extension SignalServiceProtos_CallMessage.IceUpdate: SwiftProtobuf.Message, Swif 1: .same(proto: "id"), 2: .same(proto: "sdpMid"), 3: .same(proto: "sdpMLineIndex"), - 4: .same(proto: "sdp"), + 4: .same(proto: "sdp") ] mutating func decodeMessage(decoder: inout D) throws { @@ -3228,7 +3227,7 @@ extension SignalServiceProtos_CallMessage.IceUpdate: SwiftProtobuf.Message, Swif extension SignalServiceProtos_CallMessage.Busy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Busy" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), + 1: .same(proto: "id") ] mutating func decodeMessage(decoder: inout D) throws { @@ -3257,7 +3256,7 @@ extension SignalServiceProtos_CallMessage.Busy: SwiftProtobuf.Message, SwiftProt extension SignalServiceProtos_CallMessage.Hangup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = SignalServiceProtos_CallMessage.protoMessageName + ".Hangup" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), + 1: .same(proto: "id") ] mutating func decodeMessage(decoder: inout D) throws { @@ -3298,23 +3297,23 @@ extension SignalServiceProtos_DataMessage: SwiftProtobuf.Message, SwiftProtobuf. 10: .same(proto: "preview"), 11: .same(proto: "sticker"), 12: .same(proto: "requiredProtocolVersion"), - 14: .same(proto: "isViewOnce"), + 14: .same(proto: "isViewOnce") ] fileprivate class _StorageClass { - var _body: String? = nil + var _body: String? var _attachments: [SignalServiceProtos_AttachmentPointer] = [] - var _group: SignalServiceProtos_GroupContext? = nil - var _flags: UInt32? = nil - var _expireTimer: UInt32? = nil - var _profileKey: Data? = nil - var _timestamp: UInt64? = nil - var _quote: SignalServiceProtos_DataMessage.Quote? = nil + var _group: SignalServiceProtos_GroupContext? + var _flags: UInt32? + var _expireTimer: UInt32? + var _profileKey: Data? + var _timestamp: UInt64? + var _quote: SignalServiceProtos_DataMessage.Quote? var _contact: [SignalServiceProtos_DataMessage.Contact] = [] var _preview: [SignalServiceProtos_DataMessage.Preview] = [] - var _sticker: SignalServiceProtos_DataMessage.Sticker? = nil - var _requiredProtocolVersion: UInt32? = nil - var _isViewOnce: Bool? = nil + var _sticker: SignalServiceProtos_DataMessage.Sticker? + var _requiredProtocolVersion: UInt32? + var _isViewOnce: Bool? static let defaultInstance = _StorageClass() @@ -3444,7 +3443,7 @@ extension SignalServiceProtos_DataMessage.Flags: SwiftProtobuf._ProtoNameProvidi static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "END_SESSION"), 2: .same(proto: "EXPIRATION_TIMER_UPDATE"), - 4: .same(proto: "PROFILE_KEY_UPDATE"), + 4: .same(proto: "PROFILE_KEY_UPDATE") ] } @@ -3452,7 +3451,8 @@ extension SignalServiceProtos_DataMessage.ProtocolVersion: SwiftProtobuf._ProtoN static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 0: .same(proto: "INITIAL"), 1: .same(proto: "MESSAGE_TIMERS"), - 2: .aliased(proto: "VIEW_ONCE", aliases: ["CURRENT"]), + 2: .same(proto: "VIEW_ONCE"), + 3: .aliased(proto: "VIEW_ONCE_VIDEO", aliases: ["CURRENT"]) ] } @@ -3463,7 +3463,7 @@ extension SignalServiceProtos_DataMessage.Quote: SwiftProtobuf.Message, SwiftPro 2: .same(proto: "authorE164"), 5: .same(proto: "authorUuid"), 3: .same(proto: "text"), - 4: .same(proto: "attachments"), + 4: .same(proto: "attachments") ] mutating func decodeMessage(decoder: inout D) throws { @@ -3515,14 +3515,14 @@ extension SignalServiceProtos_DataMessage.Quote.QuotedAttachment: SwiftProtobuf. 1: .same(proto: "contentType"), 2: .same(proto: "fileName"), 3: .same(proto: "thumbnail"), - 4: .same(proto: "flags"), + 4: .same(proto: "flags") ] fileprivate class _StorageClass { - var _contentType: String? = nil - var _fileName: String? = nil - var _thumbnail: SignalServiceProtos_AttachmentPointer? = nil - var _flags: UInt32? = nil + var _contentType: String? + var _fileName: String? + var _thumbnail: SignalServiceProtos_AttachmentPointer? + var _flags: UInt32? static let defaultInstance = _StorageClass() @@ -3596,7 +3596,7 @@ extension SignalServiceProtos_DataMessage.Quote.QuotedAttachment: SwiftProtobuf. extension SignalServiceProtos_DataMessage.Quote.QuotedAttachment.Flags: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "VOICE_MESSAGE"), + 1: .same(proto: "VOICE_MESSAGE") ] } @@ -3608,16 +3608,16 @@ extension SignalServiceProtos_DataMessage.Contact: SwiftProtobuf.Message, SwiftP 4: .same(proto: "email"), 5: .same(proto: "address"), 6: .same(proto: "avatar"), - 7: .same(proto: "organization"), + 7: .same(proto: "organization") ] fileprivate class _StorageClass { - var _name: SignalServiceProtos_DataMessage.Contact.Name? = nil + var _name: SignalServiceProtos_DataMessage.Contact.Name? var _number: [SignalServiceProtos_DataMessage.Contact.Phone] = [] var _email: [SignalServiceProtos_DataMessage.Contact.Email] = [] var _address: [SignalServiceProtos_DataMessage.Contact.PostalAddress] = [] - var _avatar: SignalServiceProtos_DataMessage.Contact.Avatar? = nil - var _organization: String? = nil + var _avatar: SignalServiceProtos_DataMessage.Contact.Avatar? + var _organization: String? static let defaultInstance = _StorageClass() @@ -3709,7 +3709,7 @@ extension SignalServiceProtos_DataMessage.Contact.Name: SwiftProtobuf.Message, S 3: .same(proto: "prefix"), 4: .same(proto: "suffix"), 5: .same(proto: "middleName"), - 6: .same(proto: "displayName"), + 6: .same(proto: "displayName") ] mutating func decodeMessage(decoder: inout D) throws { @@ -3765,7 +3765,7 @@ extension SignalServiceProtos_DataMessage.Contact.Phone: SwiftProtobuf.Message, static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "value"), 2: .same(proto: "type"), - 3: .same(proto: "label"), + 3: .same(proto: "label") ] mutating func decodeMessage(decoder: inout D) throws { @@ -3806,7 +3806,7 @@ extension SignalServiceProtos_DataMessage.Contact.Phone.TypeEnum: SwiftProtobuf. 1: .same(proto: "HOME"), 2: .same(proto: "MOBILE"), 3: .same(proto: "WORK"), - 4: .same(proto: "CUSTOM"), + 4: .same(proto: "CUSTOM") ] } @@ -3815,7 +3815,7 @@ extension SignalServiceProtos_DataMessage.Contact.Email: SwiftProtobuf.Message, static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "value"), 2: .same(proto: "type"), - 3: .same(proto: "label"), + 3: .same(proto: "label") ] mutating func decodeMessage(decoder: inout D) throws { @@ -3856,7 +3856,7 @@ extension SignalServiceProtos_DataMessage.Contact.Email.TypeEnum: SwiftProtobuf. 1: .same(proto: "HOME"), 2: .same(proto: "MOBILE"), 3: .same(proto: "WORK"), - 4: .same(proto: "CUSTOM"), + 4: .same(proto: "CUSTOM") ] } @@ -3871,7 +3871,7 @@ extension SignalServiceProtos_DataMessage.Contact.PostalAddress: SwiftProtobuf.M 6: .same(proto: "city"), 7: .same(proto: "region"), 8: .same(proto: "postcode"), - 9: .same(proto: "country"), + 9: .same(proto: "country") ] mutating func decodeMessage(decoder: inout D) throws { @@ -3941,7 +3941,7 @@ extension SignalServiceProtos_DataMessage.Contact.PostalAddress.TypeEnum: SwiftP static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "HOME"), 2: .same(proto: "WORK"), - 3: .same(proto: "CUSTOM"), + 3: .same(proto: "CUSTOM") ] } @@ -3949,12 +3949,12 @@ extension SignalServiceProtos_DataMessage.Contact.Avatar: SwiftProtobuf.Message, static let protoMessageName: String = SignalServiceProtos_DataMessage.Contact.protoMessageName + ".Avatar" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "avatar"), - 2: .same(proto: "isProfile"), + 2: .same(proto: "isProfile") ] fileprivate class _StorageClass { - var _avatar: SignalServiceProtos_AttachmentPointer? = nil - var _isProfile: Bool? = nil + var _avatar: SignalServiceProtos_AttachmentPointer? + var _isProfile: Bool? static let defaultInstance = _StorageClass() @@ -4019,13 +4019,13 @@ extension SignalServiceProtos_DataMessage.Preview: SwiftProtobuf.Message, SwiftP static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "url"), 2: .same(proto: "title"), - 3: .same(proto: "image"), + 3: .same(proto: "image") ] fileprivate class _StorageClass { - var _url: String? = nil - var _title: String? = nil - var _image: SignalServiceProtos_AttachmentPointer? = nil + var _url: String? + var _title: String? + var _image: SignalServiceProtos_AttachmentPointer? static let defaultInstance = _StorageClass() @@ -4097,14 +4097,14 @@ extension SignalServiceProtos_DataMessage.Sticker: SwiftProtobuf.Message, SwiftP 1: .same(proto: "packId"), 2: .same(proto: "packKey"), 3: .same(proto: "stickerId"), - 4: .same(proto: "data"), + 4: .same(proto: "data") ] fileprivate class _StorageClass { - var _packID: Data? = nil - var _packKey: Data? = nil - var _stickerID: UInt32? = nil - var _data: SignalServiceProtos_AttachmentPointer? = nil + var _packID: Data? + var _packKey: Data? + var _stickerID: UInt32? + var _data: SignalServiceProtos_AttachmentPointer? static let defaultInstance = _StorageClass() @@ -4179,7 +4179,7 @@ extension SignalServiceProtos_DataMessage.Sticker: SwiftProtobuf.Message, SwiftP extension SignalServiceProtos_NullMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".NullMessage" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "padding"), + 1: .same(proto: "padding") ] mutating func decodeMessage(decoder: inout D) throws { @@ -4209,7 +4209,7 @@ extension SignalServiceProtos_ReceiptMessage: SwiftProtobuf.Message, SwiftProtob static let protoMessageName: String = _protobuf_package + ".ReceiptMessage" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "type"), - 2: .same(proto: "timestamp"), + 2: .same(proto: "timestamp") ] mutating func decodeMessage(decoder: inout D) throws { @@ -4243,7 +4243,7 @@ extension SignalServiceProtos_ReceiptMessage: SwiftProtobuf.Message, SwiftProtob extension SignalServiceProtos_ReceiptMessage.TypeEnum: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 0: .same(proto: "DELIVERY"), - 1: .same(proto: "READ"), + 1: .same(proto: "READ") ] } @@ -4254,7 +4254,7 @@ extension SignalServiceProtos_Verified: SwiftProtobuf.Message, SwiftProtobuf._Me 5: .same(proto: "destinationUuid"), 2: .same(proto: "identityKey"), 3: .same(proto: "state"), - 4: .same(proto: "nullMessage"), + 4: .same(proto: "nullMessage") ] mutating func decodeMessage(decoder: inout D) throws { @@ -4304,7 +4304,7 @@ extension SignalServiceProtos_Verified.State: SwiftProtobuf._ProtoNameProviding static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 0: .same(proto: "DEFAULT"), 1: .same(proto: "VERIFIED"), - 2: .same(proto: "UNVERIFIED"), + 2: .same(proto: "UNVERIFIED") ] } @@ -4321,21 +4321,21 @@ extension SignalServiceProtos_SyncMessage: SwiftProtobuf.Message, SwiftProtobuf. 9: .same(proto: "configuration"), 8: .same(proto: "padding"), 10: .same(proto: "stickerPackOperation"), - 11: .same(proto: "viewOnceOpen"), + 11: .same(proto: "viewOnceOpen") ] fileprivate class _StorageClass { - var _sent: SignalServiceProtos_SyncMessage.Sent? = nil - var _contacts: SignalServiceProtos_SyncMessage.Contacts? = nil - var _groups: SignalServiceProtos_SyncMessage.Groups? = nil - var _request: SignalServiceProtos_SyncMessage.Request? = nil + var _sent: SignalServiceProtos_SyncMessage.Sent? + var _contacts: SignalServiceProtos_SyncMessage.Contacts? + var _groups: SignalServiceProtos_SyncMessage.Groups? + var _request: SignalServiceProtos_SyncMessage.Request? var _read: [SignalServiceProtos_SyncMessage.Read] = [] - var _blocked: SignalServiceProtos_SyncMessage.Blocked? = nil - var _verified: SignalServiceProtos_Verified? = nil - var _configuration: SignalServiceProtos_SyncMessage.Configuration? = nil - var _padding: Data? = nil + var _blocked: SignalServiceProtos_SyncMessage.Blocked? + var _verified: SignalServiceProtos_Verified? + var _configuration: SignalServiceProtos_SyncMessage.Configuration? + var _padding: Data? var _stickerPackOperation: [SignalServiceProtos_SyncMessage.StickerPackOperation] = [] - var _viewOnceOpen: SignalServiceProtos_SyncMessage.ViewOnceOpen? = nil + var _viewOnceOpen: SignalServiceProtos_SyncMessage.ViewOnceOpen? static let defaultInstance = _StorageClass() @@ -4458,17 +4458,17 @@ extension SignalServiceProtos_SyncMessage.Sent: SwiftProtobuf.Message, SwiftProt 3: .same(proto: "message"), 4: .same(proto: "expirationStartTimestamp"), 5: .same(proto: "unidentifiedStatus"), - 6: .same(proto: "isRecipientUpdate"), + 6: .same(proto: "isRecipientUpdate") ] fileprivate class _StorageClass { - var _destinationE164: String? = nil - var _destinationUuid: String? = nil - var _timestamp: UInt64? = nil - var _message: SignalServiceProtos_DataMessage? = nil - var _expirationStartTimestamp: UInt64? = nil + var _destinationE164: String? + var _destinationUuid: String? + var _timestamp: UInt64? + var _message: SignalServiceProtos_DataMessage? + var _expirationStartTimestamp: UInt64? var _unidentifiedStatus: [SignalServiceProtos_SyncMessage.Sent.UnidentifiedDeliveryStatus] = [] - var _isRecipientUpdate: Bool? = nil + var _isRecipientUpdate: Bool? static let defaultInstance = _StorageClass() @@ -4563,7 +4563,7 @@ extension SignalServiceProtos_SyncMessage.Sent.UnidentifiedDeliveryStatus: Swift static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "destinationE164"), 3: .same(proto: "destinationUuid"), - 2: .same(proto: "unidentified"), + 2: .same(proto: "unidentified") ] mutating func decodeMessage(decoder: inout D) throws { @@ -4603,12 +4603,12 @@ extension SignalServiceProtos_SyncMessage.Contacts: SwiftProtobuf.Message, Swift static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Contacts" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "blob"), - 2: .same(proto: "isComplete"), + 2: .same(proto: "isComplete") ] fileprivate class _StorageClass { - var _blob: SignalServiceProtos_AttachmentPointer? = nil - var _isComplete: Bool? = nil + var _blob: SignalServiceProtos_AttachmentPointer? + var _isComplete: Bool? static let defaultInstance = _StorageClass() @@ -4671,11 +4671,11 @@ extension SignalServiceProtos_SyncMessage.Contacts: SwiftProtobuf.Message, Swift extension SignalServiceProtos_SyncMessage.Groups: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Groups" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "blob"), + 1: .same(proto: "blob") ] fileprivate class _StorageClass { - var _blob: SignalServiceProtos_AttachmentPointer? = nil + var _blob: SignalServiceProtos_AttachmentPointer? static let defaultInstance = _StorageClass() @@ -4734,7 +4734,7 @@ extension SignalServiceProtos_SyncMessage.Blocked: SwiftProtobuf.Message, SwiftP static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "numbers"), 2: .same(proto: "groupIds"), - 3: .same(proto: "uuids"), + 3: .same(proto: "uuids") ] mutating func decodeMessage(decoder: inout D) throws { @@ -4773,7 +4773,7 @@ extension SignalServiceProtos_SyncMessage.Blocked: SwiftProtobuf.Message, SwiftP extension SignalServiceProtos_SyncMessage.Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = SignalServiceProtos_SyncMessage.protoMessageName + ".Request" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "type"), + 1: .same(proto: "type") ] mutating func decodeMessage(decoder: inout D) throws { @@ -4805,7 +4805,7 @@ extension SignalServiceProtos_SyncMessage.Request.TypeEnum: SwiftProtobuf._Proto 1: .same(proto: "CONTACTS"), 2: .same(proto: "GROUPS"), 3: .same(proto: "BLOCKED"), - 4: .same(proto: "CONFIGURATION"), + 4: .same(proto: "CONFIGURATION") ] } @@ -4814,7 +4814,7 @@ extension SignalServiceProtos_SyncMessage.Read: SwiftProtobuf.Message, SwiftProt static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "senderE164"), 3: .same(proto: "senderUuid"), - 2: .same(proto: "timestamp"), + 2: .same(proto: "timestamp") ] mutating func decodeMessage(decoder: inout D) throws { @@ -4856,7 +4856,7 @@ extension SignalServiceProtos_SyncMessage.Configuration: SwiftProtobuf.Message, 1: .same(proto: "readReceipts"), 2: .same(proto: "unidentifiedDeliveryIndicators"), 3: .same(proto: "typingIndicators"), - 4: .same(proto: "linkPreviews"), + 4: .same(proto: "linkPreviews") ] mutating func decodeMessage(decoder: inout D) throws { @@ -4902,7 +4902,7 @@ extension SignalServiceProtos_SyncMessage.StickerPackOperation: SwiftProtobuf.Me static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "packId"), 2: .same(proto: "packKey"), - 3: .same(proto: "type"), + 3: .same(proto: "type") ] mutating func decodeMessage(decoder: inout D) throws { @@ -4941,7 +4941,7 @@ extension SignalServiceProtos_SyncMessage.StickerPackOperation: SwiftProtobuf.Me extension SignalServiceProtos_SyncMessage.StickerPackOperation.TypeEnum: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 0: .same(proto: "INSTALL"), - 1: .same(proto: "REMOVE"), + 1: .same(proto: "REMOVE") ] } @@ -4950,7 +4950,7 @@ extension SignalServiceProtos_SyncMessage.ViewOnceOpen: SwiftProtobuf.Message, S static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "senderE164"), 3: .same(proto: "senderUuid"), - 2: .same(proto: "timestamp"), + 2: .same(proto: "timestamp") ] mutating func decodeMessage(decoder: inout D) throws { @@ -4999,7 +4999,7 @@ extension SignalServiceProtos_AttachmentPointer: SwiftProtobuf.Message, SwiftPro 8: .same(proto: "flags"), 9: .same(proto: "width"), 10: .same(proto: "height"), - 11: .same(proto: "caption"), + 11: .same(proto: "caption") ] mutating func decodeMessage(decoder: inout D) throws { @@ -5077,7 +5077,7 @@ extension SignalServiceProtos_AttachmentPointer: SwiftProtobuf.Message, SwiftPro extension SignalServiceProtos_AttachmentPointer.Flags: SwiftProtobuf._ProtoNameProviding { static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "VOICE_MESSAGE"), + 1: .same(proto: "VOICE_MESSAGE") ] } @@ -5089,15 +5089,15 @@ extension SignalServiceProtos_GroupContext: SwiftProtobuf.Message, SwiftProtobuf 3: .same(proto: "name"), 4: .same(proto: "membersE164"), 5: .same(proto: "avatar"), - 6: .same(proto: "members"), + 6: .same(proto: "members") ] fileprivate class _StorageClass { - var _id: Data? = nil - var _type: SignalServiceProtos_GroupContext.TypeEnum? = nil - var _name: String? = nil + var _id: Data? + var _type: SignalServiceProtos_GroupContext.TypeEnum? + var _name: String? var _membersE164: [String] = [] - var _avatar: SignalServiceProtos_AttachmentPointer? = nil + var _avatar: SignalServiceProtos_AttachmentPointer? var _members: [SignalServiceProtos_GroupContext.Member] = [] static let defaultInstance = _StorageClass() @@ -5188,7 +5188,7 @@ extension SignalServiceProtos_GroupContext.TypeEnum: SwiftProtobuf._ProtoNamePro 1: .same(proto: "UPDATE"), 2: .same(proto: "DELIVER"), 3: .same(proto: "QUIT"), - 4: .same(proto: "REQUEST_INFO"), + 4: .same(proto: "REQUEST_INFO") ] } @@ -5196,7 +5196,7 @@ extension SignalServiceProtos_GroupContext.Member: SwiftProtobuf.Message, SwiftP static let protoMessageName: String = SignalServiceProtos_GroupContext.protoMessageName + ".Member" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "uuid"), - 2: .same(proto: "e164"), + 2: .same(proto: "e164") ] mutating func decodeMessage(decoder: inout D) throws { @@ -5238,19 +5238,19 @@ extension SignalServiceProtos_ContactDetails: SwiftProtobuf.Message, SwiftProtob 5: .same(proto: "verified"), 6: .same(proto: "profileKey"), 7: .same(proto: "blocked"), - 8: .same(proto: "expireTimer"), + 8: .same(proto: "expireTimer") ] fileprivate class _StorageClass { - var _number: String? = nil - var _uuid: String? = nil - var _name: String? = nil - var _avatar: SignalServiceProtos_ContactDetails.Avatar? = nil - var _color: String? = nil - var _verified: SignalServiceProtos_Verified? = nil - var _profileKey: Data? = nil - var _blocked: Bool? = nil - var _expireTimer: UInt32? = nil + var _number: String? + var _uuid: String? + var _name: String? + var _avatar: SignalServiceProtos_ContactDetails.Avatar? + var _color: String? + var _verified: SignalServiceProtos_Verified? + var _profileKey: Data? + var _blocked: Bool? + var _expireTimer: UInt32? static let defaultInstance = _StorageClass() @@ -5356,7 +5356,7 @@ extension SignalServiceProtos_ContactDetails.Avatar: SwiftProtobuf.Message, Swif static let protoMessageName: String = SignalServiceProtos_ContactDetails.protoMessageName + ".Avatar" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "contentType"), - 2: .same(proto: "length"), + 2: .same(proto: "length") ] mutating func decodeMessage(decoder: inout D) throws { @@ -5398,18 +5398,18 @@ extension SignalServiceProtos_GroupDetails: SwiftProtobuf.Message, SwiftProtobuf 6: .same(proto: "expireTimer"), 7: .same(proto: "color"), 8: .same(proto: "blocked"), - 9: .same(proto: "members"), + 9: .same(proto: "members") ] fileprivate class _StorageClass { - var _id: Data? = nil - var _name: String? = nil + var _id: Data? + var _name: String? var _membersE164: [String] = [] - var _avatar: SignalServiceProtos_GroupDetails.Avatar? = nil - var _active: Bool? = nil - var _expireTimer: UInt32? = nil - var _color: String? = nil - var _blocked: Bool? = nil + var _avatar: SignalServiceProtos_GroupDetails.Avatar? + var _active: Bool? + var _expireTimer: UInt32? + var _color: String? + var _blocked: Bool? var _members: [SignalServiceProtos_GroupDetails.Member] = [] static let defaultInstance = _StorageClass() @@ -5516,7 +5516,7 @@ extension SignalServiceProtos_GroupDetails.Avatar: SwiftProtobuf.Message, SwiftP static let protoMessageName: String = SignalServiceProtos_GroupDetails.protoMessageName + ".Avatar" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "contentType"), - 2: .same(proto: "length"), + 2: .same(proto: "length") ] mutating func decodeMessage(decoder: inout D) throws { @@ -5551,7 +5551,7 @@ extension SignalServiceProtos_GroupDetails.Member: SwiftProtobuf.Message, SwiftP static let protoMessageName: String = SignalServiceProtos_GroupDetails.protoMessageName + ".Member" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "uuid"), - 2: .same(proto: "e164"), + 2: .same(proto: "e164") ] mutating func decodeMessage(decoder: inout D) throws { @@ -5588,13 +5588,13 @@ extension SignalServiceProtos_Pack: SwiftProtobuf.Message, SwiftProtobuf._Messag 1: .same(proto: "title"), 2: .same(proto: "author"), 3: .same(proto: "cover"), - 4: .same(proto: "stickers"), + 4: .same(proto: "stickers") ] fileprivate class _StorageClass { - var _title: String? = nil - var _author: String? = nil - var _cover: SignalServiceProtos_Pack.Sticker? = nil + var _title: String? + var _author: String? + var _cover: SignalServiceProtos_Pack.Sticker? var _stickers: [SignalServiceProtos_Pack.Sticker] = [] static let defaultInstance = _StorageClass() @@ -5671,7 +5671,7 @@ extension SignalServiceProtos_Pack.Sticker: SwiftProtobuf.Message, SwiftProtobuf static let protoMessageName: String = SignalServiceProtos_Pack.protoMessageName + ".Sticker" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "id"), - 2: .same(proto: "emoji"), + 2: .same(proto: "emoji") ] mutating func decodeMessage(decoder: inout D) throws { diff --git a/SignalServiceKit/src/Storage/Database/SDSDatabaseStorage.swift b/SignalServiceKit/src/Storage/Database/SDSDatabaseStorage.swift index 4efbe25b1e..7765830141 100644 --- a/SignalServiceKit/src/Storage/Database/SDSDatabaseStorage.swift +++ b/SignalServiceKit/src/Storage/Database/SDSDatabaseStorage.swift @@ -155,7 +155,9 @@ public class SDSDatabaseStorage: SDSTransactable { // crash if we can't read the DB. do { - return try GRDBDatabaseStorageAdapter(baseDir: type(of: self).baseDir()) + return try Bench(title: "Creating GRDB storage") { + return try GRDBDatabaseStorageAdapter(baseDir: type(of: self).baseDir()) + } } catch { owsFail("\(error)") } @@ -188,8 +190,10 @@ public class SDSDatabaseStorage: SDSTransactable { } } - let yapPrimaryStorage = OWSPrimaryStorage() - return YAPDBStorageAdapter(storage: yapPrimaryStorage) + return Bench(title: "Creating YDB storage") { + let yapPrimaryStorage = OWSPrimaryStorage() + return YAPDBStorageAdapter(storage: yapPrimaryStorage) + } } // MARK: - diff --git a/SignalServiceKit/src/Util/DataSource.m b/SignalServiceKit/src/Util/DataSource.m index 0c80a391fd..3938c9461c 100755 --- a/SignalServiceKit/src/Util/DataSource.m +++ b/SignalServiceKit/src/Util/DataSource.m @@ -179,7 +179,12 @@ NS_ASSUME_NONNULL_BEGIN OWSAssertDebug(self->_cachedFileUrl != nil); } - NSURL *srcUrl = self.dataUrl; + NSURL *_Nullable srcUrl = self.dataUrl; + if (srcUrl == nil) { + *error = OWSErrorMakeAssertionError(@"Missing data URL."); + success = NO; + return; + } self.isConsumed = YES; success = [NSFileManager.defaultManager moveItemAtURL:srcUrl toURL:dstUrl diff --git a/SignalServiceKit/src/Util/ExperienceUpgradeFinder.swift b/SignalServiceKit/src/Util/ExperienceUpgradeFinder.swift index 84fe6cf586..7a97714ebe 100644 --- a/SignalServiceKit/src/Util/ExperienceUpgradeFinder.swift +++ b/SignalServiceKit/src/Util/ExperienceUpgradeFinder.swift @@ -65,7 +65,7 @@ public enum ExperienceUpgradeId: String { @objc public func markAsSeen(experienceUpgrade: ExperienceUpgrade, transaction: SDSAnyWriteTransaction) { Logger.info("marking experience upgrade as seen") - experienceUpgrade.anyInsert(transaction: transaction) + experienceUpgrade.anyUpsert(transaction: transaction) } @objc diff --git a/SignalServiceKit/src/Util/FeatureFlags.swift b/SignalServiceKit/src/Util/FeatureFlags.swift index d0ed0e6477..c253575b82 100644 --- a/SignalServiceKit/src/Util/FeatureFlags.swift +++ b/SignalServiceKit/src/Util/FeatureFlags.swift @@ -18,7 +18,7 @@ extension FeatureBuild { } } -let build: FeatureBuild = OWSIsDebugBuild() ? .dev : .beta +let build: FeatureBuild = OWSIsDebugBuild() ? .dev : .qa // MARK: - @@ -90,10 +90,7 @@ public class FeatureFlags: NSObject { @objc public static var storageMode: StorageMode { if CurrentAppContext().isRunningTests { - // We should be running the tests using both .ydbTests or .grdbTests. - return .grdbTests - } else if build.includes(.dev) { - return .grdbThrowawayIfMigrating + return .ydbTests } else { return .ydb } diff --git a/SignalShareExtension/Info.plist b/SignalShareExtension/Info.plist index 23a77d3dc7..8d6ce2793f 100644 --- a/SignalShareExtension/Info.plist +++ b/SignalShareExtension/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 2.44.0 CFBundleVersion - 2.44.0.0 + 2.44.0.5 ITSAppUsesNonExemptEncryption NSAppTransportSecurity