|
@@ -296,22 +296,22 @@ extension ChatListController: UITableViewDataSource, UITableViewDelegate {
|
|
|
private func askToChatWith(contactId: Int) {
|
|
|
assert(searchController.isActive)
|
|
|
searchController.searchBar.text = nil
|
|
|
- searchController.dismiss(animated: false) {
|
|
|
- let dcContact = DcContact(id: contactId)
|
|
|
- let alert = UIAlertController(title: String.localizedStringWithFormat(String.localized("ask_start_chat_with"), dcContact.nameNAddr),
|
|
|
- message: nil,
|
|
|
- preferredStyle: .safeActionSheet)
|
|
|
- alert.addAction(UIAlertAction(title: String.localized("start_chat"), style: .default, handler: { _ in
|
|
|
+
|
|
|
+ let dcContact = DcContact(id: contactId)
|
|
|
+ let alert = UIAlertController(title: String.localizedStringWithFormat(String.localized("ask_start_chat_with"), dcContact.nameNAddr),
|
|
|
+ message: nil,
|
|
|
+ preferredStyle: .safeActionSheet)
|
|
|
+ alert.addAction(UIAlertAction(title: String.localized("start_chat"), style: .default, handler: { _ in
|
|
|
+ self.searchController.dismiss(animated: false) {
|
|
|
self.dismiss(animated: true, completion: nil)
|
|
|
self.coordinator?.showNewChat(contactId: contactId)
|
|
|
- }))
|
|
|
- alert.addAction(UIAlertAction(title: String.localized("cancel"), style: .cancel, handler: { _ in
|
|
|
- self.dismiss(animated: true, completion: nil)
|
|
|
- }))
|
|
|
- self.present(alert, animated: true, completion: nil)
|
|
|
- }
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ alert.addAction(UIAlertAction(title: String.localized("cancel"), style: .cancel, handler: { _ in
|
|
|
+ self.dismiss(animated: true, completion: nil)
|
|
|
+ }))
|
|
|
+ self.present(alert, animated: true, completion: nil)
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -321,7 +321,7 @@ extension ChatListController: UISearchBarDelegate {
|
|
|
return true
|
|
|
}
|
|
|
|
|
|
- func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
|
|
|
+ func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
|
|
|
viewModel.endFiltering()
|
|
|
}
|
|
|
}
|