|
@@ -2,7 +2,6 @@ import UIKit
|
|
import UserNotifications
|
|
import UserNotifications
|
|
|
|
|
|
let dcNotificationChanged = Notification.Name(rawValue: "MrEventMsgsChanged")
|
|
let dcNotificationChanged = Notification.Name(rawValue: "MrEventMsgsChanged")
|
|
-let dcNotificationStateChanged = Notification.Name(rawValue: "MrEventStateChanged")
|
|
|
|
let dcNotificationIncoming = Notification.Name(rawValue: "MrEventIncomingMsg")
|
|
let dcNotificationIncoming = Notification.Name(rawValue: "MrEventIncomingMsg")
|
|
let dcNotificationImexProgress = Notification.Name(rawValue: "dcNotificationImexProgress")
|
|
let dcNotificationImexProgress = Notification.Name(rawValue: "dcNotificationImexProgress")
|
|
let dcNotificationConfigureProgress = Notification.Name(rawValue: "MrEventConfigureProgress")
|
|
let dcNotificationConfigureProgress = Notification.Name(rawValue: "MrEventConfigureProgress")
|
|
@@ -77,25 +76,9 @@ public func callbackSwift(event: CInt, data1: CUnsignedLong, data2: CUnsignedLon
|
|
logger.warning("network: \(msg)")
|
|
logger.warning("network: \(msg)")
|
|
}
|
|
}
|
|
|
|
|
|
- let nc = NotificationCenter.default
|
|
|
|
- DispatchQueue.main.async {
|
|
|
|
- DispatchQueue.main.async {
|
|
|
|
- nc.post(name: dcNotificationStateChanged,
|
|
|
|
- object: nil,
|
|
|
|
- userInfo: ["state": "offline"])
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
case DC_EVENT_IMAP_CONNECTED, DC_EVENT_SMTP_CONNECTED:
|
|
case DC_EVENT_IMAP_CONNECTED, DC_EVENT_SMTP_CONNECTED:
|
|
logger.warning("network: \(String(cString: data2String))")
|
|
logger.warning("network: \(String(cString: data2String))")
|
|
|
|
|
|
- let nc = NotificationCenter.default
|
|
|
|
- DispatchQueue.main.async {
|
|
|
|
- nc.post(name: dcNotificationStateChanged,
|
|
|
|
- object: nil,
|
|
|
|
- userInfo: ["state": "online"])
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
case DC_EVENT_MSGS_CHANGED, DC_EVENT_MSG_READ, DC_EVENT_MSG_DELIVERED:
|
|
case DC_EVENT_MSGS_CHANGED, DC_EVENT_MSG_READ, DC_EVENT_MSG_DELIVERED:
|
|
logger.info("change: \(event)")
|
|
logger.info("change: \(event)")
|
|
|
|
|