Make replies tappable

pull/347/head
Niels Andriesse 3 years ago
parent 477a5e49b6
commit 547f5bf540

@ -387,8 +387,12 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc
let shareVC = UIActivityViewController(activityItems: [ url ], applicationActivities: nil)
navigationController!.present(shareVC, animated: true, completion: nil)
case .textOnlyMessage:
guard let preview = viewItem.linkPreview, let urlAsString = preview.urlString, let url = URL(string: urlAsString) else { return }
openURL(url)
if let preview = viewItem.linkPreview, let urlAsString = preview.urlString, let url = URL(string: urlAsString) {
openURL(url)
} else if let reply = viewItem.quotedReply {
guard let indexPath = viewModel.ensureLoadWindowContainsQuotedReply(reply) else { return }
messagesTableView.scrollToRow(at: indexPath, at: UITableView.ScrollPosition.middle, animated: true)
}
default: break
}
}

@ -1,6 +1,5 @@
// TODO
// Tapping replies
// Disappearing messages timer
// Brendan no likey buttons above text field
// Slight paging glitch
@ -492,7 +491,7 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
scrollToInteraction(with: interactionID)
}
private func scrollToInteraction(with interactionID: String) {
func scrollToInteraction(with interactionID: String) {
guard let indexPath = viewModel.ensureLoadWindowContainsInteractionId(interactionID) else { return }
messagesTableView.scrollToRow(at: indexPath, at: UITableView.ScrollPosition.middle, animated: true)
}

@ -322,7 +322,7 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, UIViewC
presentedVC.dismiss(animated: false, completion: nil)
}
let displayName = OWSProfileManager.shared().profileNameForRecipient(withID: getUserHexEncodedPublicKey())
if displayName == "Brendan" && 0.2 < Double.random(in: 0...1) { // Show Brendan the old screen approx 1 out of 5 times to mess with him
if displayName == "Brendan" && 0.4 < Double.random(in: 0...1) { // Show Brendan the old screen approx 1 out of 5 times to mess with him
let conversationVC = ConversationViewController()
conversationVC.configure(for: thread, action: action, focusMessageId: highlightedMessageID)
self.navigationController?.setViewControllers([ self, conversationVC ], animated: true)

Loading…
Cancel
Save