From 7eb1352f9b72e608547503a02db4bd2b0de5e0d3 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Tue, 26 Nov 2024 13:30:32 +0100 Subject: [PATCH] add sendUpdateInterval and sendUpdateMaxSize api --- .../Controller/WebxdcViewController.swift | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/deltachat-ios/Controller/WebxdcViewController.swift b/deltachat-ios/Controller/WebxdcViewController.swift index 28de7dcef..15850445a 100644 --- a/deltachat-ios/Controller/WebxdcViewController.swift +++ b/deltachat-ios/Controller/WebxdcViewController.swift @@ -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? @@ -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(""); @@ -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 @@ -324,10 +333,6 @@ class WebxdcViewController: WebViewViewController { !sourceCode.isEmpty { sourceCodeUrl = sourceCode } - - if let addr = dict["self_addr"] as? String { - selfAddr = addr - } } // MARK: - Notifications