소스 검색

filter DC_EVENT_CONNECTIVITY_CHANGED for the currently active account

cyberta 4 년 전
부모
커밋
49896ea9d3
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      DcCore/DcCore/DC/events.swift

+ 3 - 0
DcCore/DcCore/DC/events.swift

@@ -227,6 +227,9 @@ public class DcEventHandler {
             }
             }
 
 
         case DC_EVENT_CONNECTIVITY_CHANGED:
         case DC_EVENT_CONNECTIVITY_CHANGED:
+            if dcContext.id != dcAccounts.getSelected().id {
+                return
+            }
             dcContext.logger?.info("network: DC_EVENT_CONNECTIVITY_CHANGED: \(dcContext.getConnectivity())")
             dcContext.logger?.info("network: DC_EVENT_CONNECTIVITY_CHANGED: \(dcContext.getConnectivity())")
             DispatchQueue.main.async {
             DispatchQueue.main.async {
                 let nc = NotificationCenter.default
                 let nc = NotificationCenter.default