From 9eec81850e418a3c16410b4870910bde142b06e3 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期三, 14 九月 2022 15:50:00 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/Dev-Branch' into wjc

---
 HDL_ON/Common/HDLCommon.cs |   71 +++++++++++++++++++++--------------
 1 files changed, 43 insertions(+), 28 deletions(-)

diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
index e77da10..1a42157 100644
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -301,9 +301,23 @@
                     else if (jpushMessageInfo.messageType.Contains(PushMessageType.HDL_INTERPHONE.ToString()))
                     {
                         if (string.IsNullOrEmpty(jpushMessageInfo.expantContent)) return;
-
+                        
                         //瀛楁鍏煎闂锛屽彧鑳界洿鎺ュ彇鍊间簡
                         var json = Newtonsoft.Json.Linq.JObject.Parse(jpushMessageInfo.expantContent);
+                        try
+                        {
+                            var pushTime = json["pushTime"];
+                            if (!string.IsNullOrEmpty(pushTime.ToString()))
+                            {
+                                var pushDateTime = Utlis.UnixToDateTimeMS(Convert.ToInt64(pushTime));
+                                if (pushDateTime.AddSeconds(30) < DateTime.Now)
+                                {
+                                    return;
+                                }
+                            }
+                        }
+                        catch { }
+
                         //1.瑙嗗璁插巶瀹剁被鍨�
                         string interphoneTypeEnum = json["interphoneTypeEnum"].ToString();
                         if (string.IsNullOrEmpty(interphoneTypeEnum)) return;
@@ -330,31 +344,33 @@
                         }
                         else if (interphoneTypeEnum == InterphoneType.HDL.ToString())
                         {
+                            //HDL Linphone 鐙勮�愬厠
                             eSVideoInfo.HomeId = jpushMessageInfo.HomeId;
                             eSVideoInfo.callId = json["callId"].ToString();
                             eSVideoInfo.Lc_DeviceId = json["deviceId"].ToString();
                             eSVideoInfo.DeviceName = json["deviceName"].ToString();
                             eSVideoInfo.deviceSipAccount = json["deviceSipAccount"].ToString();
+                            eSVideoInfo.spk = json["spk"].ToString();
 
+                            //ShowAlert("鐙勮�愬厠闂ㄥ彛鏈哄懠鍙�");
+                            //鎵撳紑鍛煎彨椤甸潰
+                            HDLLinphone.Current.ShowESVideoIntercom(eSVideoInfo, InterphoneType.HDL.ToString());
+                            return;
+                        }
+                        else if (interphoneTypeEnum == InterphoneType.FREEVIEW.ToString())
+                        {
+                            //鍏ㄨ閫� Linphone 鐙勮�愬厠
+                            eSVideoInfo.HomeId = jpushMessageInfo.HomeId;
+                            eSVideoInfo.callId = json["callId"].ToString();
+                            eSVideoInfo.Lc_DeviceId = json["deviceId"].ToString();
+                            eSVideoInfo.DeviceName = json["deviceName"].ToString();
+                            eSVideoInfo.deviceSipAccount = json["deviceSipAccount"].ToString();
+                            eSVideoInfo.spk = json["spk"].ToString();
 
-                            if (json.ContainsKey("spk"))
-                            {
-                                if (json["spk"].ToString() == "door.gate")
-                                {
-                                    new PublicAssmebly().TipLinphoneCall("\""+ eSVideoInfo.DeviceName + "\"鍛煎彨", eSVideoInfo);
-
-                                    //HDLLinphone.Current.ShowESVideoIntercom(eSVideoInfo,true);
-                                    return;
-                                }
-                                else
-                                {
-                                    //HDL Linphone 鐙勮�愬厠
-                                    //ShowAlert("鐙勮�愬厠闂ㄥ彛鏈哄懠鍙�");
-                                    //鎵撳紑鍛煎彨椤甸潰
-                                    HDLLinphone.Current.ShowESVideoIntercom(eSVideoInfo,false);
-                                    return;
-                                }
-                            }
+                            //ShowAlert("鐙勮�愬厠闂ㄥ彛鏈哄懠鍙�");
+                            //鎵撳紑鍛煎彨椤甸潰
+                            HDLLinphone.Current.ShowESVideoIntercom(eSVideoInfo, InterphoneType.FREEVIEW.ToString());
+                            return;
                         }
 
                         //3.鎵撳紑鍛煎彨椤甸潰
@@ -417,14 +433,13 @@
             //璐﹀彿鍦ㄥ埆澶勭櫥闄嗭紝琚涪涓嬬嚎 璺宠浆鍒扮櫥褰曢〉闈�
             new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show();
 
-            Logout(false);
+            Logout();
         }
 
         /// <summary>
         /// 閫�鍑虹櫥褰曟搷浣�
-        /// signOutPush 鏄惁鍒犻櫎鎺ㄩ�乼oken
         /// </summary>
-        public void Logout(bool signOutPush = true)
+        public void Logout()
         {
             //鍔犺浇Loading鏁堟灉
             var waitPage = new Loading();
@@ -435,19 +450,19 @@
             {
                 try
                 {
-                    if (signOutPush)
-                    {
-                        //2.娉ㄩ攢鎺ㄩ��
-                        new HttpServerRequest().SignOutPush();
-                    }
+                    //2.娉ㄩ攢鎺ㄩ��
+                    new HttpServerRequest().SignOutPush();
                     //3.璺宠浆鐧诲綍椤甸潰
                     UserInfo.Current.LastTime = DateTime.MinValue;
                     UserInfo.Current.SaveUserInfo();
                     DB_ResidenceData.Instance.EixtAccount();
                     //4.娉ㄩ攢HDLSIP璐﹀彿鐧诲綍 2021-08-20
                     HDLLinphone.Current.LogoutAllAccount();
+
 #if __IOS__
-                    //5.娓呯┖Siri鍏变韩鏁版嵁淇℃伅
+                    //5.鍏ㄨ閫氱櫥鍑�
+                    Shared.IOS.HDLFVSDK.Video.Logout();
+                    //6.娓呯┖Siri鍏变韩鏁版嵁淇℃伅
                     new Other.SkipControl().SetData(false, "", "", "","");
                     var sDM = new SiriKit.SceneDateManager();
                     Console.WriteLine($"IsLogin:{sDM.IsLgoin};accessToken:{sDM.AccessToken};refreshToken:{sDM.RefreshToken};RegionUrl:{sDM.RegionUrl};HomeId:{sDM.HomeId}");

--
Gitblit v1.8.0