TM-SGNL-iOS/Signal/ConversationView/ConversationViewController+Mentions.swift
TeleMessage developers dde0620daf initial commit
2025-05-03 12:28:28 -07:00

39 lines
1.3 KiB
Swift

//
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
public import SignalServiceKit
public import SignalUI
extension ConversationViewController: BodyRangesTextViewDelegate {
var supportsMentions: Bool { thread.allowsMentionSend }
public func textViewDidBeginTypingMention(_ textView: BodyRangesTextView) {}
public func textViewDidEndTypingMention(_ textView: BodyRangesTextView) {}
public func textViewMentionPickerParentView(_ textView: BodyRangesTextView) -> UIView? {
view
}
public func textViewMentionPickerReferenceView(_ textView: BodyRangesTextView) -> UIView? {
bottomBar
}
public func textViewMentionPickerPossibleAddresses(_ textView: BodyRangesTextView, tx: DBReadTransaction) -> [SignalServiceAddress] {
supportsMentions ? thread.recipientAddresses(with: SDSDB.shimOnlyBridge(tx)) : []
}
public func textViewMentionCacheInvalidationKey(_ textView: BodyRangesTextView) -> String {
return thread.uniqueId
}
public func textViewDisplayConfiguration(_ textView: BodyRangesTextView) -> HydratedMessageBody.DisplayConfiguration {
return .composing(textViewColor: textView.textColor)
}
public func mentionPickerStyle(_ textView: BodyRangesTextView) -> MentionPickerStyle {
return .default
}
}