Skip to content

Commit

Permalink
Show Webxdc-message in chat (#2413)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitschlag committed Dec 9, 2024
1 parent 85ee6d6 commit d7ef97a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions deltachat-ios/Controller/WebxdcViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,17 @@ class WebxdcViewController: WebViewViewController {
let shareAction = UIAlertAction(title: String.localized("menu_share"), style: .default, handler: shareWebxdc(_:))
alert.addAction(shareAction)

let showInChatAction = UIAlertAction(title: String.localized("show_in_chat"), style: .default) { [weak self] _ in
guard let self, let appDelegate = UIApplication.shared.delegate as? AppDelegate else { return }
let message = dcContext.getMessage(id: self.messageId)
let chatId = message.chatId

DispatchQueue.main.async {
appDelegate.appCoordinator.showChat(chatId: chatId, msgId: message.id, animated: true, clearViewControllerStack: true)
}
}
alert.addAction(showInChatAction)

let cancelAction = UIAlertAction(title: String.localized("cancel"), style: .cancel, handler: nil)
alert.addAction(cancelAction)
self.present(alert, animated: true, completion: nil)
Expand Down

0 comments on commit d7ef97a

Please sign in to comment.