Skip to content

Commit

Permalink
add sendUpdateInterval and sendUpdateMaxSize api
Browse files Browse the repository at this point in the history
  • Loading branch information
r10s committed Nov 26, 2024
1 parent 8a4072d commit 7eb1352
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions deltachat-ios/Controller/WebxdcViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class WebxdcViewController: WebViewViewController {
var webxdcName: String = ""
var sourceCodeUrl: String?
var selfAddr: String = ""
var sendUpdateInterval: Int = 0
var sendUpdateMaxSize: Int = 0
private var allowInternet: Bool = false

private var shortcutManager: ShortcutManager?
Expand Down Expand Up @@ -129,7 +131,11 @@ class WebxdcViewController: WebViewViewController {
selfAddr: decodeURI("\((addr ?? "unknown"))"),
selfName: decodeURI("\((displayname ?? "unknown"))"),
sendUpdateInterval: \(sendUpdateInterval),
sendUpdateMaxSize: \(sendUpdateMaxSize),
joinRealtimeChannel: () => {
realtimeChannel = createRealtimeChannel();
webkit.messageHandlers.sendRealtimeAdvertisement.postMessage("");
Expand Down Expand Up @@ -316,6 +322,9 @@ class WebxdcViewController: WebViewViewController {

let document = dict["document"] as? String ?? ""
webxdcName = dict["name"] as? String ?? "ErrName" // name should not be empty
selfAddr = dict["self_addr"] as? String ?? "ErrAddr"
sendUpdateInterval = dict["send_update_interval"] as? Int ?? 0
sendUpdateMaxSize = dict["send_update_max_size"] as? Int ?? 0
let chatName = dcContext.getChat(chatId: msg.chatId).name
self.allowInternet = dict["internet_access"] as? Bool ?? false

Expand All @@ -324,10 +333,6 @@ class WebxdcViewController: WebViewViewController {
!sourceCode.isEmpty {
sourceCodeUrl = sourceCode
}

if let addr = dict["self_addr"] as? String {
selfAddr = addr
}
}

// MARK: - Notifications
Expand Down

0 comments on commit 7eb1352

Please sign in to comment.