瀏覽代碼

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)
         }