Skip to content

Commit

Permalink
Add menu entry to send contacts (#2186)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitschlag committed Jun 13, 2024
1 parent a253f36 commit b7ad5ca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions deltachat-ios/Chat/ChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,7 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate {
let cameraAction = PhotoPickerAlertAction(title: String.localized("camera"), style: .default, handler: cameraButtonPressed(_:))
let documentAction = UIAlertAction(title: String.localized("files"), style: .default, handler: documentActionPressed(_:))
let voiceMessageAction = UIAlertAction(title: String.localized("voice_message"), style: .default, handler: voiceMessageButtonPressed(_:))
let sendContactAction = UIAlertAction(title: String.localized("contact"), style: .default, handler: showContactList(_:))
let isLocationStreaming = dcContext.isSendingLocationsToChat(chatId: chatId)
let locationStreamingAction = UIAlertAction(title: isLocationStreaming ? String.localized("stop_sharing_location") : String.localized("location"),
style: isLocationStreaming ? .destructive : .default,
Expand All @@ -1286,6 +1287,9 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate {
if UserDefaults.standard.bool(forKey: "location_streaming") {
alert.addAction(locationStreamingAction)
}

alert.addAction(sendContactAction)

alert.addAction(UIAlertAction(title: String.localized("cancel"), style: .cancel, handler: nil))
self.present(alert, animated: true, completion: {
// unfortunately, voiceMessageAction.accessibilityHint does not work,
Expand Down Expand Up @@ -1526,6 +1530,10 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate {
showPhotoVideoLibrary(delegate: self)
}

private func showContactList(_ action: UIAlertAction) {
//TODO: Show contact list

Check warning on line 1534 in deltachat-ios/Chat/ChatViewController.swift

View workflow job for this annotation

GitHub Actions / build

Comment Spacing Violation: Prefer at least one space after slashes for comments (comment_spacing)
}

private func locationStreamingButtonPressed(_ action: UIAlertAction) {
let isLocationStreaming = dcContext.isSendingLocationsToChat(chatId: chatId)
if isLocationStreaming {
Expand Down

0 comments on commit b7ad5ca

Please sign in to comment.