Add superclass for transient outgoing messages
This commit is contained in:
parent
c4b902f854
commit
238588a6d6
@ -714,6 +714,7 @@
|
||||
505CC1692F22C2EC00D311CD /* OutgoingPaymentActivationRequestFinishedMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 505CC1682F22C2EC00D311CD /* OutgoingPaymentActivationRequestFinishedMessage.swift */; };
|
||||
505F76332BC45C0700B1B51C /* BuildFlags+Generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 505F76322BC45C0700B1B51C /* BuildFlags+Generated.swift */; };
|
||||
5060EBBA2C7D211A00DF77AD /* OutgoingCallLinkUpdateMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5060EBB92C7D211A00DF77AD /* OutgoingCallLinkUpdateMessage.swift */; };
|
||||
506395812F2403BE00B2F772 /* TransientOutgoingMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 506395802F2403BE00B2F772 /* TransientOutgoingMessage.swift */; };
|
||||
5063B41E2C5432A30041CA51 /* ResolvableValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5063B41D2C5432A30041CA51 /* ResolvableValue.swift */; };
|
||||
506695E129C296D500B6D8D0 /* RecipientMergerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 506695E029C296D500B6D8D0 /* RecipientMergerTest.swift */; };
|
||||
506695E329C29BCE00B6D8D0 /* RecipientMerger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 506695E229C29BCE00B6D8D0 /* RecipientMerger.swift */; };
|
||||
@ -4870,6 +4871,7 @@
|
||||
505CC1682F22C2EC00D311CD /* OutgoingPaymentActivationRequestFinishedMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutgoingPaymentActivationRequestFinishedMessage.swift; sourceTree = "<group>"; };
|
||||
505F76322BC45C0700B1B51C /* BuildFlags+Generated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BuildFlags+Generated.swift"; sourceTree = "<group>"; };
|
||||
5060EBB92C7D211A00DF77AD /* OutgoingCallLinkUpdateMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutgoingCallLinkUpdateMessage.swift; sourceTree = "<group>"; };
|
||||
506395802F2403BE00B2F772 /* TransientOutgoingMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransientOutgoingMessage.swift; sourceTree = "<group>"; };
|
||||
5063B41D2C5432A30041CA51 /* ResolvableValue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResolvableValue.swift; sourceTree = "<group>"; };
|
||||
506695E029C296D500B6D8D0 /* RecipientMergerTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecipientMergerTest.swift; sourceTree = "<group>"; };
|
||||
506695E229C29BCE00B6D8D0 /* RecipientMerger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecipientMerger.swift; sourceTree = "<group>"; };
|
||||
@ -14393,6 +14395,7 @@
|
||||
50B0E9472AC73C3B005D46AB /* RecipientStateMerger.swift */,
|
||||
504F98B22EB0270A00DF465B /* SendMessageFailure.swift */,
|
||||
50A5AA9A2A7449D000CF2ECC /* ServerReceiptEnvelope.swift */,
|
||||
506395802F2403BE00B2F772 /* TransientOutgoingMessage.swift */,
|
||||
F9C5C947289453B100548EEE /* TypingIndicatorMessage.swift */,
|
||||
504F397B29D23B1700E849A6 /* ValidatedIncomingEnvelope.swift */,
|
||||
);
|
||||
@ -19469,6 +19472,7 @@
|
||||
7203F5352D53B83500639949 /* TimeInterval+SSK.swift in Sources */,
|
||||
C14EC1A22BA891D200A4D064 /* TransformingInputStream.swift in Sources */,
|
||||
C1CF83D42B9A207800CDC9C4 /* TransformingOutputStream.swift in Sources */,
|
||||
506395812F2403BE00B2F772 /* TransientOutgoingMessage.swift in Sources */,
|
||||
661170C42ABA4D9900A1B16D /* TSAccountManager.swift in Sources */,
|
||||
661170C82ABA4F3A00A1B16D /* TSAccountManagerImpl.swift in Sources */,
|
||||
664657472ACB66630099DE1C /* TSAccountManagerObjcBridge.swift in Sources */,
|
||||
|
||||
@ -289,7 +289,7 @@ extension ConversationViewController: MessageActionsDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
func sendPinMessageChange(pinMessage: TSOutgoingMessage) async throws {
|
||||
func sendPinMessageChange(pinMessage: TransientOutgoingMessage) async throws {
|
||||
let db = DependenciesBridge.shared.db
|
||||
let messageSenderJobQueue = SSKEnvironment.shared.messageSenderJobQueueRef
|
||||
let pinnedMessageManager = DependenciesBridge.shared.pinnedMessageManager
|
||||
@ -341,7 +341,7 @@ extension ConversationViewController: MessageActionsDelegate {
|
||||
|
||||
func queuePinMessageChangeWithModal(
|
||||
message: TSMessage,
|
||||
pinMessage: TSOutgoingMessage,
|
||||
pinMessage: TransientOutgoingMessage,
|
||||
modalDelegate: UIViewController,
|
||||
completion: (() -> Void)?,
|
||||
) async {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
///
|
||||
/// Not to be confused with an ``OWSGroupCallMessage``.
|
||||
@objc(OWSOutgoingGroupCallMessage)
|
||||
public final class OutgoingGroupCallUpdateMessage: TSOutgoingMessage {
|
||||
public final class OutgoingGroupCallUpdateMessage: TransientOutgoingMessage {
|
||||
override public class var supportsSecureCoding: Bool { true }
|
||||
|
||||
public required init?(coder: NSCoder) {
|
||||
@ -56,8 +56,6 @@ public final class OutgoingGroupCallUpdateMessage: TSOutgoingMessage {
|
||||
)
|
||||
}
|
||||
|
||||
override public var shouldBeSaved: Bool { false }
|
||||
|
||||
override var contentHint: SealedSenderContentHint { .default }
|
||||
|
||||
override public func dataMessageBuilder(
|
||||
|
||||
@ -10,7 +10,7 @@ public import LibSignalClient
|
||||
/// payload out-of-band.
|
||||
///
|
||||
/// Not to be confused with a ``TSCall``.
|
||||
public final class OutgoingCallMessage: TSOutgoingMessage {
|
||||
public final class OutgoingCallMessage: TransientOutgoingMessage {
|
||||
public enum MessageType: Hashable {
|
||||
case offerMessage(SSKProtoCallMessageOffer)
|
||||
case answerMessage(SSKProtoCallMessageAnswer)
|
||||
@ -110,8 +110,6 @@ public final class OutgoingCallMessage: TSOutgoingMessage {
|
||||
}
|
||||
}
|
||||
|
||||
override public var shouldBeSaved: Bool { false }
|
||||
|
||||
override public var isUrgent: Bool {
|
||||
switch self.messageType {
|
||||
case .offerMessage:
|
||||
|
||||
@ -21,7 +21,7 @@ public final class MessageSenderJobRecord: JobRecord, FactoryInitializableFromRe
|
||||
|
||||
/// A message we send but which is never inserted into the Interactions table;
|
||||
/// its only used for sending.
|
||||
private let transientMessage: TSOutgoingMessage?
|
||||
private let transientMessage: TransientOutgoingMessage?
|
||||
|
||||
// exposed for tests
|
||||
let removeMessageAfterSending: Bool
|
||||
@ -33,7 +33,7 @@ public final class MessageSenderJobRecord: JobRecord, FactoryInitializableFromRe
|
||||
messageForSending: OutgoingEditMessage,
|
||||
useMediaQueue: Bool,
|
||||
)
|
||||
case transient(TSOutgoingMessage)
|
||||
case transient(TransientOutgoingMessage)
|
||||
/// Generally considered invalid, but failed at processing time not deserialization time.
|
||||
case none
|
||||
}
|
||||
@ -145,7 +145,7 @@ public final class MessageSenderJobRecord: JobRecord, FactoryInitializableFromRe
|
||||
}
|
||||
|
||||
convenience init(
|
||||
transientMessage: TSOutgoingMessage,
|
||||
transientMessage: TransientOutgoingMessage,
|
||||
isHighPriority: Bool,
|
||||
) {
|
||||
owsPrecondition(
|
||||
@ -183,9 +183,9 @@ public final class MessageSenderJobRecord: JobRecord, FactoryInitializableFromRe
|
||||
transientMessage = try container.decodeIfPresent(
|
||||
Data.self,
|
||||
forKey: .transientMessage,
|
||||
).flatMap { invisibleMessageData -> TSOutgoingMessage? in
|
||||
).flatMap { invisibleMessageData -> TransientOutgoingMessage? in
|
||||
do {
|
||||
return try LegacySDSSerializer().deserializeLegacySDSData(invisibleMessageData, ofClass: TSOutgoingMessage.self)
|
||||
return try LegacySDSSerializer().deserializeLegacySDSData(invisibleMessageData, ofClass: TransientOutgoingMessage.self)
|
||||
} catch {
|
||||
owsFailDebug("couldn't decode transient message: \(error)")
|
||||
return nil
|
||||
|
||||
@ -11,7 +11,7 @@ import Foundation
|
||||
* notifying your devices of sent messages, and "read" receipts.
|
||||
*/
|
||||
@objc(OWSOutgoingSyncMessage)
|
||||
public class OutgoingSyncMessage: TSOutgoingMessage {
|
||||
public class OutgoingSyncMessage: TransientOutgoingMessage {
|
||||
|
||||
override public class var supportsSecureCoding: Bool { true }
|
||||
|
||||
@ -42,8 +42,6 @@ public class OutgoingSyncMessage: TSOutgoingMessage {
|
||||
)
|
||||
}
|
||||
|
||||
override public var shouldBeSaved: Bool { false }
|
||||
|
||||
override public func shouldSyncTranscript() -> Bool { false }
|
||||
|
||||
// This method should not be overridden because we want to add random padding to *every* sync message
|
||||
|
||||
@ -7,7 +7,7 @@ import Foundation
|
||||
|
||||
// This needs to reflect the edit as represented (and sourced) from the db.
|
||||
@objc
|
||||
public final class OutgoingEditMessage: TSOutgoingMessage {
|
||||
public final class OutgoingEditMessage: TransientOutgoingMessage {
|
||||
override public class var supportsSecureCoding: Bool { true }
|
||||
|
||||
public required init?(coder: NSCoder) {
|
||||
@ -51,9 +51,6 @@ public final class OutgoingEditMessage: TSOutgoingMessage {
|
||||
|
||||
// MARK: - Overrides
|
||||
|
||||
@objc
|
||||
override public var shouldBeSaved: Bool { false }
|
||||
|
||||
@objc
|
||||
override public var debugDescription: String { "editMessage" }
|
||||
|
||||
|
||||
@ -6,12 +6,10 @@
|
||||
import Foundation
|
||||
|
||||
@objc(OWSDisappearingMessagesConfigurationMessage)
|
||||
final class DisappearingMessagesConfigurationMessage: TSOutgoingMessage {
|
||||
final class DisappearingMessagesConfigurationMessage: TransientOutgoingMessage {
|
||||
|
||||
private let configuration: OWSDisappearingMessagesConfiguration
|
||||
|
||||
override var shouldBeSaved: Bool { false }
|
||||
|
||||
override var isUrgent: Bool { false }
|
||||
|
||||
init(
|
||||
|
||||
@ -7,7 +7,7 @@ import Foundation
|
||||
public import LibSignalClient
|
||||
|
||||
@objc(TSOutgoingDeleteMessage)
|
||||
public final class OutgoingDeleteMessage: TSOutgoingMessage {
|
||||
public final class OutgoingDeleteMessage: TransientOutgoingMessage {
|
||||
let messageTimestamp: UInt64
|
||||
let messageUniqueId: String?
|
||||
let isDeletingStoryMessage: Bool
|
||||
@ -90,8 +90,6 @@ public final class OutgoingDeleteMessage: TSOutgoingMessage {
|
||||
)
|
||||
}
|
||||
|
||||
override public var shouldBeSaved: Bool { false }
|
||||
|
||||
override public var isStorySend: Bool {
|
||||
return self.isDeletingStoryMessage
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import Foundation
|
||||
|
||||
@objc(OWSEndSessionMessage)
|
||||
final class OutgoingEndSessionMessage: TSOutgoingMessage {
|
||||
final class OutgoingEndSessionMessage: TransientOutgoingMessage {
|
||||
override class var supportsSecureCoding: Bool { true }
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
@ -24,8 +24,6 @@ final class OutgoingEndSessionMessage: TSOutgoingMessage {
|
||||
)
|
||||
}
|
||||
|
||||
override var shouldBeSaved: Bool { false }
|
||||
|
||||
override func dataMessageBuilder(with thread: TSThread, transaction: DBReadTransaction) -> SSKProtoDataMessageBuilder? {
|
||||
guard let builder = super.dataMessageBuilder(with: thread, transaction: transaction) else {
|
||||
return nil
|
||||
|
||||
@ -8,7 +8,7 @@ import Foundation
|
||||
// A generic, serializable message that can be used to
|
||||
// send fixed plaintextData payloads.
|
||||
@objc(OWSStaticOutgoingMessage)
|
||||
final class OutgoingStaticMessage: TSOutgoingMessage {
|
||||
final class OutgoingStaticMessage: TransientOutgoingMessage {
|
||||
|
||||
let plaintextData: Data
|
||||
|
||||
@ -59,8 +59,6 @@ final class OutgoingStaticMessage: TSOutgoingMessage {
|
||||
return true
|
||||
}
|
||||
|
||||
override var shouldBeSaved: Bool { false }
|
||||
|
||||
override func shouldSyncTranscript() -> Bool { false }
|
||||
|
||||
override func buildPlainTextData(_ thread: TSThread, transaction: DBWriteTransaction) -> Data? {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import Foundation
|
||||
public import LibSignalClient
|
||||
|
||||
public class OutgoingPinMessage: TSOutgoingMessage {
|
||||
public class OutgoingPinMessage: TransientOutgoingMessage {
|
||||
override public class var supportsSecureCoding: Bool { true }
|
||||
|
||||
public required init?(coder: NSCoder) {
|
||||
@ -93,8 +93,6 @@ public class OutgoingPinMessage: TSOutgoingMessage {
|
||||
)
|
||||
}
|
||||
|
||||
override public var shouldBeSaved: Bool { false }
|
||||
|
||||
override var contentHint: SealedSenderContentHint { .implicit }
|
||||
|
||||
override public func dataMessageBuilder(
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import Foundation
|
||||
public import LibSignalClient
|
||||
|
||||
public class OutgoingUnpinMessage: TSOutgoingMessage {
|
||||
public class OutgoingUnpinMessage: TransientOutgoingMessage {
|
||||
override public class var supportsSecureCoding: Bool { true }
|
||||
|
||||
public required init?(coder: NSCoder) {
|
||||
@ -73,8 +73,6 @@ public class OutgoingUnpinMessage: TSOutgoingMessage {
|
||||
)
|
||||
}
|
||||
|
||||
override public var shouldBeSaved: Bool { false }
|
||||
|
||||
override var contentHint: SealedSenderContentHint { .implicit }
|
||||
|
||||
override public func dataMessageBuilder(
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
class OutgoingPollTerminateMessage: TSOutgoingMessage {
|
||||
class OutgoingPollTerminateMessage: TransientOutgoingMessage {
|
||||
override class var supportsSecureCoding: Bool { true }
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
@ -58,8 +58,6 @@ class OutgoingPollTerminateMessage: TSOutgoingMessage {
|
||||
)
|
||||
}
|
||||
|
||||
override var shouldBeSaved: Bool { false }
|
||||
|
||||
override var contentHint: SealedSenderContentHint { .implicit }
|
||||
|
||||
override func dataMessageBuilder(
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import Foundation
|
||||
public import LibSignalClient
|
||||
|
||||
public class OutgoingPollVoteMessage: TSOutgoingMessage {
|
||||
public class OutgoingPollVoteMessage: TransientOutgoingMessage {
|
||||
override public class var supportsSecureCoding: Bool { true }
|
||||
|
||||
public required init?(coder: NSCoder) {
|
||||
@ -87,8 +87,6 @@ public class OutgoingPollVoteMessage: TSOutgoingMessage {
|
||||
)
|
||||
}
|
||||
|
||||
override public var shouldBeSaved: Bool { false }
|
||||
|
||||
override var contentHint: SealedSenderContentHint { .implicit }
|
||||
|
||||
override public func dataMessageBuilder(
|
||||
|
||||
@ -7,7 +7,7 @@ import Foundation
|
||||
import LibSignalClient
|
||||
|
||||
@objc(OWSOutgoingResendResponse)
|
||||
final class OWSOutgoingResendResponse: TSOutgoingMessage {
|
||||
final class OWSOutgoingResendResponse: TransientOutgoingMessage {
|
||||
override class var supportsSecureCoding: Bool { true }
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
@ -144,8 +144,6 @@ final class OWSOutgoingResendResponse: TSOutgoingMessage {
|
||||
|
||||
override func shouldSyncTranscript() -> Bool { false }
|
||||
|
||||
override var shouldBeSaved: Bool { false }
|
||||
|
||||
override var contentHint: SealedSenderContentHint { self.derivedContentHint }
|
||||
|
||||
override func envelopeGroupIdWithTransaction(_ transaction: DBReadTransaction) -> Data? { self.originalGroupId }
|
||||
|
||||
@ -7,7 +7,7 @@ import Foundation
|
||||
import LibSignalClient
|
||||
|
||||
/// An outgoing group v2 update.
|
||||
final class OutgoingGroupUpdateMessage: TSOutgoingMessage {
|
||||
final class OutgoingGroupUpdateMessage: TransientOutgoingMessage {
|
||||
override class var supportsSecureCoding: Bool { true }
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
@ -67,6 +67,4 @@ final class OutgoingGroupUpdateMessage: TSOutgoingMessage {
|
||||
}
|
||||
|
||||
override var isUrgent: Bool { self.isUpdateUrgent }
|
||||
|
||||
override var shouldBeSaved: Bool { false }
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ public class PreparedOutgoingMessage {
|
||||
/// (2) don't have any attachments associated with them
|
||||
/// Instantly prepares because...these messages don't need any preparing.
|
||||
public static func preprepared(
|
||||
transientMessageWithoutAttachments: TSOutgoingMessage,
|
||||
transientMessageWithoutAttachments: TransientOutgoingMessage,
|
||||
) -> PreparedOutgoingMessage {
|
||||
UnpreparedOutgoingMessage.assertIsAllowedTransientMessage(transientMessageWithoutAttachments)
|
||||
return _preprepared(transientMessage: transientMessageWithoutAttachments)
|
||||
@ -64,7 +64,7 @@ public class PreparedOutgoingMessage {
|
||||
/// (2) don't have any attachments that need to be uploaded
|
||||
/// Instantly prepares because...these messages don't need any preparing.
|
||||
private static func _preprepared(
|
||||
transientMessage: TSOutgoingMessage,
|
||||
transientMessage: TransientOutgoingMessage,
|
||||
) -> PreparedOutgoingMessage {
|
||||
let messageType = MessageType.transient(transientMessage)
|
||||
return PreparedOutgoingMessage(messageType: messageType)
|
||||
@ -127,7 +127,7 @@ public class PreparedOutgoingMessage {
|
||||
/// Catch-all for messages not persisted to the Interactions table. The
|
||||
/// MessageSender will not upload any attachments contained within these
|
||||
/// messages; callers are responsible for uploading them.
|
||||
case transient(TSOutgoingMessage)
|
||||
case transient(TransientOutgoingMessage)
|
||||
|
||||
public struct Persisted {
|
||||
public let rowId: Int64
|
||||
|
||||
@ -27,7 +27,8 @@ public class UnpreparedOutgoingMessage {
|
||||
let oversizeTextDataSource = (body?.oversizeText).map {
|
||||
AttachmentDataSource.pendingAttachment($0)
|
||||
}
|
||||
if !message.shouldBeSaved {
|
||||
// TODO: Split these methods once TSOutgoingMessage is no longer the superclass.
|
||||
if let message = message as? TransientOutgoingMessage {
|
||||
owsAssertDebug(
|
||||
unsavedBodyMediaAttachments.isEmpty
|
||||
&& oversizeTextDataSource == nil
|
||||
@ -39,6 +40,7 @@ public class UnpreparedOutgoingMessage {
|
||||
Self.assertIsAllowedTransientMessage(message)
|
||||
return .init(messageType: .transient(message))
|
||||
} else {
|
||||
owsPrecondition(message.shouldBeSaved)
|
||||
return .init(messageType: .persistable(.init(
|
||||
message: message,
|
||||
unsavedBodyMediaAttachments: unsavedBodyMediaAttachments,
|
||||
@ -121,7 +123,7 @@ public class UnpreparedOutgoingMessage {
|
||||
/// Catch-all for messages not persisted to the Interactions table. The
|
||||
/// MessageSender will not upload any attachments contained within these
|
||||
/// messages; callers are responsible for uploading them.
|
||||
case transient(TSOutgoingMessage)
|
||||
case transient(TransientOutgoingMessage)
|
||||
|
||||
struct Persistable {
|
||||
let message: TSOutgoingMessage
|
||||
@ -160,14 +162,7 @@ public class UnpreparedOutgoingMessage {
|
||||
let preparedMessageType: PreparedOutgoingMessage.MessageType
|
||||
switch messageType {
|
||||
case .persistable(let message):
|
||||
if message.message.shouldBeSaved {
|
||||
preparedMessageType = try preparePersistableMessage(message, tx: tx)
|
||||
} else {
|
||||
owsFailDebug("Unknown unsaved message type!")
|
||||
// As a last resort, still send the message. But don't bother with
|
||||
// attachments, those are dropped if we don't know how to handle them.
|
||||
preparedMessageType = prepareTransientMessage(message.message)
|
||||
}
|
||||
preparedMessageType = try preparePersistableMessage(message, tx: tx)
|
||||
case .editMessage(let message):
|
||||
preparedMessageType = try prepareEditMessage(message, tx: tx)
|
||||
case .story(let story):
|
||||
@ -405,7 +400,7 @@ public class UnpreparedOutgoingMessage {
|
||||
}
|
||||
|
||||
private func prepareTransientMessage(
|
||||
_ message: TSOutgoingMessage,
|
||||
_ message: TransientOutgoingMessage,
|
||||
) -> PreparedOutgoingMessage.MessageType {
|
||||
return .transient(message)
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import Foundation
|
||||
|
||||
@objc(OWSOutgoingNullMessage)
|
||||
final class OutgoingNullMessage: TSOutgoingMessage {
|
||||
final class OutgoingNullMessage: TransientOutgoingMessage {
|
||||
|
||||
let verificationStateSyncMessage: OutgoingVerificationStateSyncMessage?
|
||||
|
||||
@ -82,7 +82,5 @@ final class OutgoingNullMessage: TSOutgoingMessage {
|
||||
|
||||
override func shouldSyncTranscript() -> Bool { false }
|
||||
|
||||
override var shouldBeSaved: Bool { false }
|
||||
|
||||
override var contentHint: SealedSenderContentHint { .implicit }
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import LibSignalClient
|
||||
|
||||
@objc(OWSOutgoingResendRequest)
|
||||
final class OutgoingResendRequest: TSOutgoingMessage {
|
||||
final class OutgoingResendRequest: TransientOutgoingMessage {
|
||||
let decryptionErrorData: Data
|
||||
private let failedEnvelopeGroupId: Data?
|
||||
|
||||
@ -86,8 +86,6 @@ final class OutgoingResendRequest: TSOutgoingMessage {
|
||||
|
||||
override func shouldSyncTranscript() -> Bool { false }
|
||||
|
||||
override var shouldBeSaved: Bool { false }
|
||||
|
||||
override var contentHint: SealedSenderContentHint { .default }
|
||||
|
||||
override func envelopeGroupIdWithTransaction(_ transaction: DBReadTransaction) -> Data? {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import Foundation
|
||||
import LibSignalClient
|
||||
|
||||
final class OutgoingSenderKeyDistributionMessage: TSOutgoingMessage {
|
||||
final class OutgoingSenderKeyDistributionMessage: TransientOutgoingMessage {
|
||||
|
||||
/// True if this message is being sent as a precondition to sending an
|
||||
/// online-only message. Typing indicators are only delivered to online
|
||||
@ -70,8 +70,6 @@ final class OutgoingSenderKeyDistributionMessage: TSOutgoingMessage {
|
||||
return true
|
||||
}
|
||||
|
||||
override var shouldBeSaved: Bool { false }
|
||||
|
||||
override var shouldRecordSendLog: Bool { false }
|
||||
|
||||
override var isUrgent: Bool { false }
|
||||
|
||||
@ -8,7 +8,7 @@ import Foundation
|
||||
/// Outgoing message we send to the contact who requested we activate payments.
|
||||
/// NOT rendered in chat; a separate TSInfoMessage is created for that purpose.
|
||||
@objc(OWSPaymentActivationRequestFinishedMessage)
|
||||
final class OutgoingPaymentActivationRequestFinishedMessage: TSOutgoingMessage {
|
||||
final class OutgoingPaymentActivationRequestFinishedMessage: TransientOutgoingMessage {
|
||||
|
||||
override class var supportsSecureCoding: Bool { true }
|
||||
|
||||
@ -41,6 +41,4 @@ final class OutgoingPaymentActivationRequestFinishedMessage: TSOutgoingMessage {
|
||||
}
|
||||
|
||||
override var contentHint: SealedSenderContentHint { .implicit }
|
||||
|
||||
override var shouldBeSaved: Bool { false }
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ import Foundation
|
||||
/// Outgoing message we send to the contact we want to activate payments.
|
||||
/// NOT rendered in chat; a separate TSInfoMessage is created for that purpose.
|
||||
@objc(OWSPaymentActivationRequestMessage)
|
||||
public final class OutgoingPaymentActivationRequestMessage: TSOutgoingMessage {
|
||||
public final class OutgoingPaymentActivationRequestMessage: TransientOutgoingMessage {
|
||||
|
||||
override public class var supportsSecureCoding: Bool { true }
|
||||
|
||||
@ -41,6 +41,4 @@ public final class OutgoingPaymentActivationRequestMessage: TSOutgoingMessage {
|
||||
}
|
||||
|
||||
override public var contentHint: SealedSenderContentHint { .implicit }
|
||||
|
||||
override public var shouldBeSaved: Bool { false }
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import Foundation
|
||||
public import LibSignalClient
|
||||
|
||||
@objc(OWSProfileKeyMessage)
|
||||
public final class ProfileKeyMessage: TSOutgoingMessage {
|
||||
public final class ProfileKeyMessage: TransientOutgoingMessage {
|
||||
|
||||
let profileKey: ProfileKey?
|
||||
|
||||
@ -54,8 +54,6 @@ public final class ProfileKeyMessage: TSOutgoingMessage {
|
||||
return true
|
||||
}
|
||||
|
||||
override public var shouldBeSaved: Bool { false }
|
||||
|
||||
override public func shouldSyncTranscript() -> Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import Foundation
|
||||
import LibSignalClient
|
||||
|
||||
@objc(OWSOutgoingReactionMessage)
|
||||
final class OutgoingReactionMessage: TSOutgoingMessage {
|
||||
final class OutgoingReactionMessage: TransientOutgoingMessage {
|
||||
|
||||
let messageUniqueId: String
|
||||
let emoji: String
|
||||
@ -104,8 +104,6 @@ final class OutgoingReactionMessage: TSOutgoingMessage {
|
||||
return true
|
||||
}
|
||||
|
||||
override var shouldBeSaved: Bool { false }
|
||||
|
||||
override func dataMessageBuilder(with thread: TSThread, transaction tx: DBReadTransaction) -> SSKProtoDataMessageBuilder? {
|
||||
guard let reactionProto = self.buildDataMessageReactionProto(tx: tx) else {
|
||||
return nil
|
||||
|
||||
@ -34,7 +34,7 @@ public class ReactionManager: NSObject {
|
||||
isHighPriority: Bool = false,
|
||||
tx: DBWriteTransaction,
|
||||
) -> Promise<Void> {
|
||||
let outgoingMessage: TSOutgoingMessage
|
||||
let outgoingMessage: OutgoingReactionMessage
|
||||
do {
|
||||
outgoingMessage = try _localUserReacted(to: messageUniqueId, emoji: emoji, isRemoving: isRemoving, tx: tx)
|
||||
} catch {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
final class ReceiptMessage: TSOutgoingMessage {
|
||||
final class ReceiptMessage: TransientOutgoingMessage {
|
||||
private let messageUniqueIds: Set<String>
|
||||
private let messageTimestamps: Set<UInt64>
|
||||
private let receiptType: SSKProtoReceiptMessageType
|
||||
@ -84,8 +84,6 @@ final class ReceiptMessage: TSOutgoingMessage {
|
||||
return builder.buildInfallibly()
|
||||
}
|
||||
|
||||
override var shouldBeSaved: Bool { false }
|
||||
|
||||
override var debugDescription: String {
|
||||
return "[\(type(of: self))] with message timestamps: \(self.messageTimestamps.count)"
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import Foundation
|
||||
import LibSignalClient
|
||||
|
||||
public class OutgoingStoryMessage: TSOutgoingMessage {
|
||||
public class OutgoingStoryMessage: TransientOutgoingMessage {
|
||||
override public class var supportsSecureCoding: Bool { true }
|
||||
|
||||
public required init?(coder: NSCoder) {
|
||||
@ -141,8 +141,6 @@ public class OutgoingStoryMessage: TSOutgoingMessage {
|
||||
)
|
||||
}
|
||||
|
||||
@objc
|
||||
override public var shouldBeSaved: Bool { false }
|
||||
override var contentHint: SealedSenderContentHint { .implicit }
|
||||
|
||||
override public func contentBuilder(
|
||||
|
||||
13
SignalServiceKit/Messages/TransientOutgoingMessage.swift
Normal file
13
SignalServiceKit/Messages/TransientOutgoingMessage.swift
Normal file
@ -0,0 +1,13 @@
|
||||
//
|
||||
// Copyright 2026 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objc(TransientOutgoingMessage)
|
||||
public class TransientOutgoingMessage: TSOutgoingMessage {
|
||||
override public class var supportsSecureCoding: Bool { true }
|
||||
|
||||
override public var shouldBeSaved: Bool { false }
|
||||
}
|
||||
@ -10,7 +10,7 @@ public enum TypingIndicatorAction {
|
||||
case stopped
|
||||
}
|
||||
|
||||
public final class TypingIndicatorMessage: TSOutgoingMessage {
|
||||
public final class TypingIndicatorMessage: TransientOutgoingMessage {
|
||||
override public class var supportsSecureCoding: Bool { true }
|
||||
|
||||
public required init?(coder: NSCoder) {
|
||||
@ -103,11 +103,6 @@ public final class TypingIndicatorMessage: TSOutgoingMessage {
|
||||
|
||||
// MARK: TSYapDatabaseObject overrides
|
||||
|
||||
@objc
|
||||
override public var shouldBeSaved: Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
@objc
|
||||
override public var debugDescription: String {
|
||||
return "typingIndicatorMessage"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user