Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
signalapp
GitHub Repository: signalapp/Signal-iOS
Path: blob/main/SignalServiceKit/Messages/Interactions/Quotes/QuotedReplyManagerMock.swift
1 views
//
// Copyright 2024 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//

#if TESTABLE_BUILD

import Foundation
public import UIKit

open class QuotedReplyManagerMock: QuotedReplyManager {

    public init() {}

    open func validateAndBuildQuotedReply(
        from quoteProto: SSKProtoDataMessageQuote,
        threadUniqueId: String,
        tx: DBReadTransaction,
    ) throws -> ValidatedQuotedReply {
        throw OWSAssertionError("Not implemented!")
    }

    open func buildDraftQuotedReply(
        originalMessage: TSMessage,
        loadNormalizedImage: (CGImageSource, CGFloat) -> CGImage?,
        tx: DBReadTransaction,
    ) -> DraftQuotedReplyModel? {
        return nil
    }

    open func buildDraftQuotedReplyForEditing(
        quotedReplyMessage: TSMessage,
        quotedReply: TSQuotedMessage,
        originalMessage: TSMessage?,
        loadNormalizedImage: (CGImageSource, CGFloat) -> CGImage?,
        tx: DBReadTransaction,
    ) -> DraftQuotedReplyModel {
        fatalError("Unimplemented!")
    }

    open func prepareDraftForSending(
        _ draft: DraftQuotedReplyModel,
    ) throws -> DraftQuotedReplyModel.ForSending {
        return .init(
            originalMessageTimestamp: draft.originalMessageTimestamp,
            originalMessageAuthorAddress: draft.originalMessageAuthorAddress,
            originalMessageIsGiftBadge: draft.content.isGiftBadge,
            originalMessageIsViewOnce: draft.content.isViewOnce,
            originalMessageIsPoll: draft.content.isPoll,
            threadUniqueId: draft.threadUniqueId,
            quoteBody: draft.bodyForSending,
            attachment: nil,
            quotedMessageFromEdit: nil,
        )
    }

    open func prepareQuotedReplyForSending(
        draft: DraftQuotedReplyModel.ForSending,
        tx: DBReadTransaction,
    ) -> ValidatedQuotedReply {
        fatalError("Not implemented!")
    }

    open func buildProtoForSending(
        _ quote: TSQuotedMessage,
        outgoingMessage: TSOutgoingMessage,
        tx: DBReadTransaction,
    ) throws -> SSKProtoDataMessageQuote {
        fatalError("Unimplemented!")
    }
}

#endif