Remove unused MOB code
This commit is contained in:
parent
1954342a36
commit
6628b9f6fc
@ -52,20 +52,10 @@ public enum SentMessageTranscriptType {
|
||||
public let notification: TSPaymentNotification
|
||||
}
|
||||
|
||||
public struct ArchivedPayment {
|
||||
public let target: SentMessageTranscriptTarget
|
||||
public let amount: String?
|
||||
public let fee: String?
|
||||
public let note: String?
|
||||
public let expirationStartedAt: UInt64?
|
||||
public let expirationDurationSeconds: UInt32?
|
||||
}
|
||||
|
||||
case message(Message)
|
||||
case recipientUpdate(TSGroupThread)
|
||||
case expirationTimerUpdate(SentMessageTranscriptTarget)
|
||||
case paymentNotification(PaymentNotification)
|
||||
case archivedPayment(ArchivedPayment)
|
||||
}
|
||||
|
||||
/// A transcript for a message that has already been sent, and which came in
|
||||
@ -91,8 +81,6 @@ extension SentMessageTranscript {
|
||||
return messageParams.target.thread
|
||||
case .paymentNotification(let notification):
|
||||
return notification.target.thread
|
||||
case .archivedPayment(let payment):
|
||||
return payment.target.thread
|
||||
case .recipientUpdate(let thread):
|
||||
return thread
|
||||
}
|
||||
|
||||
@ -103,36 +103,6 @@ public class SentMessageTranscriptReceiverImpl: SentMessageTranscriptReceiver {
|
||||
transaction: tx,
|
||||
)
|
||||
return .success(nil)
|
||||
case .archivedPayment(let archivedPayment):
|
||||
|
||||
guard validateProtocolVersion(for: transcript, thread: archivedPayment.target.thread, tx: tx) else {
|
||||
return .failure(OWSAssertionError("Protocol version validation failed"))
|
||||
}
|
||||
|
||||
let message = interactionStore.buildOutgoingArchivedPaymentMessage(
|
||||
builder: .withDefaultValues(
|
||||
thread: archivedPayment.target.thread,
|
||||
timestamp: transcript.timestamp,
|
||||
expiresInSeconds: archivedPayment.expirationDurationSeconds,
|
||||
// Archived payments don't set the chat timer; version is irrelevant.
|
||||
expireTimerVersion: nil,
|
||||
expireStartedAt: archivedPayment.expirationStartedAt,
|
||||
),
|
||||
amount: archivedPayment.amount,
|
||||
fee: archivedPayment.fee,
|
||||
note: archivedPayment.note,
|
||||
tx: tx,
|
||||
)
|
||||
|
||||
interactionStore.insertInteraction(message, tx: tx)
|
||||
interactionStore.updateRecipientsFromNonLocalDevice(
|
||||
message,
|
||||
recipientStates: transcript.recipientStates,
|
||||
isSentUpdate: false,
|
||||
tx: tx,
|
||||
)
|
||||
|
||||
return .success(message)
|
||||
case .expirationTimerUpdate(let target):
|
||||
Logger.info("Recording expiration timer update transcript in thread: \(target.thread.logString) timestamp: \(transcript.timestamp)")
|
||||
guard validateTimestampValue() else {
|
||||
|
||||
@ -189,7 +189,7 @@ public class OWSIncomingSentMessageTranscript: SentMessageTranscript {
|
||||
dataMessage: SSKProtoDataMessage,
|
||||
) -> Bool {
|
||||
switch type {
|
||||
case .message, .expirationTimerUpdate, .paymentNotification, .archivedPayment:
|
||||
case .message, .expirationTimerUpdate, .paymentNotification:
|
||||
// We only validate these types
|
||||
break
|
||||
case .recipientUpdate:
|
||||
|
||||
@ -75,14 +75,6 @@ public protocol InteractionStore {
|
||||
tx: DBReadTransaction,
|
||||
) -> TSOutgoingMessage
|
||||
|
||||
func buildOutgoingArchivedPaymentMessage(
|
||||
builder: TSOutgoingMessageBuilder,
|
||||
amount: String?,
|
||||
fee: String?,
|
||||
note: String?,
|
||||
tx: DBReadTransaction,
|
||||
) -> OWSOutgoingArchivedPaymentMessage
|
||||
|
||||
func insertOrReplacePlaceholder(
|
||||
for interaction: TSInteraction,
|
||||
from sender: SignalServiceAddress,
|
||||
@ -210,22 +202,6 @@ public class InteractionStoreImpl: InteractionStore {
|
||||
)
|
||||
}
|
||||
|
||||
public func buildOutgoingArchivedPaymentMessage(
|
||||
builder: TSOutgoingMessageBuilder,
|
||||
amount: String?,
|
||||
fee: String?,
|
||||
note: String?,
|
||||
tx: DBReadTransaction,
|
||||
) -> OWSOutgoingArchivedPaymentMessage {
|
||||
return OWSOutgoingArchivedPaymentMessage(
|
||||
outgoingArchivedPaymentMessageWith: builder,
|
||||
amount: amount,
|
||||
fee: fee,
|
||||
note: note,
|
||||
transaction: tx,
|
||||
)
|
||||
}
|
||||
|
||||
public func insertOrReplacePlaceholder(
|
||||
for interaction: TSInteraction,
|
||||
from sender: SignalServiceAddress,
|
||||
@ -452,16 +428,6 @@ open class MockInteractionStore: InteractionStore {
|
||||
)
|
||||
}
|
||||
|
||||
public func buildOutgoingArchivedPaymentMessage(
|
||||
builder: TSOutgoingMessageBuilder,
|
||||
amount: String?,
|
||||
fee: String?,
|
||||
note: String?,
|
||||
tx: DBReadTransaction,
|
||||
) -> OWSOutgoingArchivedPaymentMessage {
|
||||
owsFail("Not implemented, because this message type really needs an DBReadTransaction to be initialized, and at the time of writing no caller cares.")
|
||||
}
|
||||
|
||||
open func insertOrReplacePlaceholder(
|
||||
for interaction: TSInteraction,
|
||||
from sender: SignalServiceAddress,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user