|
@@ -11,6 +11,7 @@ public let dcNotificationContactChanged = Notification.Name(rawValue: "MrEventCo
|
|
|
public let dcNotificationChatModified = Notification.Name(rawValue: "dcNotificationChatModified")
|
|
|
public let dcEphemeralTimerModified = Notification.Name(rawValue: "dcEphemeralTimerModified")
|
|
|
public let dcMsgsNoticed = Notification.Name(rawValue: "dcMsgsNoticed")
|
|
|
+public let dcNotificationConnectivityChanged = Notification.Name(rawValue: "dcNotificationConnectivityChanged")
|
|
|
|
|
|
public class DcEventHandler {
|
|
|
let dcAccounts: DcAccounts
|
|
@@ -225,6 +226,17 @@ public class DcEventHandler {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
+ case DC_EVENT_CONNECTIVITY_CHANGED:
|
|
|
+ dcContext.logger?.info("network: DC_EVENT_CONNECTIVITY_CHANGED")
|
|
|
+ DispatchQueue.main.async {
|
|
|
+ let nc = NotificationCenter.default
|
|
|
+ nc.post(
|
|
|
+ name: dcNotificationConnectivityChanged,
|
|
|
+ object: nil,
|
|
|
+ userInfo: nil
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
default:
|
|
|
dcContext.logger?.warning("unknown event: \(id)")
|
|
|
}
|