Signal-iOS/Signal/src/ViewControllers/ConversationView/TypingIndicatorInteraction.swift
2019-07-11 10:52:13 -07:00

50 lines
1.3 KiB
Swift

//
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
//
import Foundation
@objc(OWSTypingIndicatorInteraction)
public class TypingIndicatorInteraction: TSInteraction {
@objc
public static let TypingIndicatorId = "TypingIndicator"
@objc
public override func isDynamicInteraction() -> Bool {
return true
}
@objc
public override func interactionType() -> OWSInteractionType {
return .typingIndicator
}
@available(*, unavailable, message:"use other constructor instead.")
@objc
public required init(coder aDecoder: NSCoder) {
notImplemented()
}
@available(*, unavailable, message:"use other constructor instead.")
@objc
public required init(dictionary dictionaryValue: [String: Any]!) throws {
notImplemented()
}
@objc
public let address: SignalServiceAddress
@objc
public init(thread: TSThread, timestamp: UInt64, address: SignalServiceAddress) {
self.address = address
super.init(uniqueId: TypingIndicatorInteraction.TypingIndicatorId,
timestamp: timestamp, in: thread)
}
@objc
public override func save(with transaction: YapDatabaseReadWriteTransaction) {
owsFailDebug("The transient interaction should not be saved in the database.")
}
}