瀏覽代碼

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:
+            if dcContext.id != dcAccounts.getSelected().id {
+                return
+            }
             dcContext.logger?.info("network: DC_EVENT_CONNECTIVITY_CHANGED: \(dcContext.getConnectivity())")
             DispatchQueue.main.async {
                 let nc = NotificationCenter.default