浏览代码

Check hovercard for NC 23

Signed-off-by: Henrik Storch <henrik.storch@nextcloud.com>
Henrik Storch 3 年之前
父节点
当前提交
e556ca4d4e
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      iOSClient/Menu/UIViewController+Menu.swift

+ 5 - 1
iOSClient/Menu/UIViewController+Menu.swift

@@ -56,11 +56,15 @@ extension UIViewController {
     
     func showProfileMenu(userId: String) {
 
+        guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { return }
+        let serverVersionMajor = NCManageDatabase.shared.getCapabilitiesServerInt(account: appDelegate.account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
+        guard serverVersionMajor >= NCGlobal.shared.nextcloudVersion23 else { return }
+
         NCCommunication.shared.getHovercard(for: userId) { (card, errCode, err) in
             guard let card = card else {
                 return
             }
-            let appDelegate = UIApplication.shared.delegate as! AppDelegate
+            
             let personHeader = NCMenuAction(
                 title: card.displayName,
                 icon: NCUtility.shared.loadUserImage(for: userId, displayName: card.displayName, urlBase: appDelegate.urlBase),