浏览代码

user status

marinofaggiana 3 年之前
父节点
当前提交
10467cbb12
共有 1 个文件被更改,包括 17 次插入2 次删除
  1. 17 2
      iOSClient/UserStatus/NCUserStatus.swift

+ 17 - 2
iOSClient/UserStatus/NCUserStatus.swift

@@ -110,8 +110,6 @@ class NCUserStatus: UIViewController {
         invisibleButton.layer.cornerRadius = 10
         invisibleButton.layer.cornerRadius = 10
         invisibleButton.layer.masksToBounds = true
         invisibleButton.layer.masksToBounds = true
         invisibleButton.backgroundColor = NCBrandColor.shared.systemGray5
         invisibleButton.backgroundColor = NCBrandColor.shared.systemGray5
-//        invisibleButton.layer.borderWidth = 1.5
-//        invisibleButton.layer.borderColor = NCBrandColor.shared.brand.cgColor
         let offline = NCUtility.shared.getUserStatus(userIcon: nil, userStatus: "offline", userMessage: nil)
         let offline = NCUtility.shared.getUserStatus(userIcon: nil, userStatus: "offline", userMessage: nil)
         invisibleImage.image = offline.onlineStatus
         invisibleImage.image = offline.onlineStatus
         invisibleLabel.text = offline.statusMessage
         invisibleLabel.text = offline.statusMessage
@@ -187,6 +185,23 @@ class NCUserStatus: UIViewController {
                 self.statusIsUserDefined = statusIsUserDefined
                 self.statusIsUserDefined = statusIsUserDefined
                 self.userId = userId
                 self.userId = userId
                 
                 
+                switch status {
+                case "online":
+                    self.onlineButton.layer.borderWidth = 1.5
+                    self.onlineButton.layer.borderColor = NCBrandColor.shared.brand.cgColor
+                case "away":
+                    self.awayButton.layer.borderWidth = 1.5
+                    self.awayButton.layer.borderColor = NCBrandColor.shared.brand.cgColor
+                case "dnd":
+                    self.dndButton.layer.borderWidth = 1.5
+                    self.dndButton.layer.borderColor = NCBrandColor.shared.brand.cgColor
+                case "invisible":
+                    self.invisibleButton.layer.borderWidth = 1.5
+                    self.invisibleButton.layer.borderColor = NCBrandColor.shared.brand.cgColor
+                default:
+                    print("No status")
+                }
+                
                 NCCommunication.shared.getUserStatusPredefinedStatuses { account, userStatuses, errorCode, errorDescription in
                 NCCommunication.shared.getUserStatusPredefinedStatuses { account, userStatuses, errorCode, errorDescription in
                     
                     
                     if errorCode == 0 {
                     if errorCode == 0 {