Преглед на файлове

only show videochat in attach menu, if video chat instance has been configured in settings

cyberta преди 4 години
родител
ревизия
ca81785004
променени са 1 файла, в които са добавени 6 реда и са изтрити 2 реда
  1. 6 2
      deltachat-ios/Chat/ChatViewController.swift

+ 6 - 2
deltachat-ios/Chat/ChatViewController.swift

@@ -991,13 +991,17 @@ class ChatViewController: UITableViewController {
         let locationStreamingAction = UIAlertAction(title: isLocationStreaming ? String.localized("stop_sharing_location") : String.localized("location"),
                                                     style: isLocationStreaming ? .destructive : .default,
                                                     handler: locationStreamingButtonPressed(_:))
-        let videoChatInvitation = UIAlertAction(title: String.localized("videochat"), style: .default, handler: videoChatButtonPressed(_:))
 
         alert.addAction(cameraAction)
         alert.addAction(galleryAction)
         alert.addAction(documentAction)
         alert.addAction(voiceMessageAction)
-        alert.addAction(videoChatInvitation)
+
+        if let config = dcContext.getConfig("webrtc_instance"), !config.isEmpty {
+            let videoChatInvitation = UIAlertAction(title: String.localized("videochat"), style: .default, handler: videoChatButtonPressed(_:))
+            alert.addAction(videoChatInvitation)
+        }
+
         if UserDefaults.standard.bool(forKey: "location_streaming") {
             alert.addAction(locationStreamingAction)
         }