Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
r10s committed Apr 9, 2024
1 parent 07733b9 commit b9eaeb3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
13 changes: 0 additions & 13 deletions deltachat-ios/Controller/MapViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,6 @@ class MapViewController: WebxdcViewController {

// MARK: - handle updates

override func sendWebxdcStatusUpdate(payload: String, description: String) -> Bool {
guard let data: Data = payload.data(using: .utf8),
let dict = (try? JSONSerialization.jsonObject(with: data, options: [])) as? [String: AnyObject],
let payload = dict["payload"] as? [String: AnyObject] else {
return false
}

let msg = dcContext.newMessage(viewType: DC_MSG_TEXT)
msg.text = payload["label"] as? String ?? "ErrLabel"
msg.setLocation(lat: payload["lat"] as? Double ?? 0.0, lng: payload["lng"] as? Double ?? 0.0)
return dcContext.sendMessage(chatId: chatId == 0 ? dcContext.createChatByContactId(contactId: Int(DC_CONTACT_ID_SELF)) : chatId, message: msg) != 0
}

override func getWebxdcStatusUpdates(lastKnownSerial: Int) -> String {
let end = Int64(Date().timeIntervalSince1970)
let begin = end - 24*60*60
Expand Down
6 changes: 1 addition & 5 deletions deltachat-ios/Controller/WebxdcViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,6 @@ class WebxdcViewController: WebViewViewController {
Utils.share(message: dcContext.getMessage(id: messageId), parentViewController: self, sourceItem: moreButton)
}

func sendWebxdcStatusUpdate(payload: String, description: String) -> Bool {
return dcContext.sendWebxdcStatusUpdate(msgId: messageId, payload: payload, description: description)
}

func getWebxdcStatusUpdates(lastKnownSerial: Int) -> String {
return dcContext.getWebxdcStatusUpdates(msgId: messageId, lastKnownSerial: lastKnownSerial)
}
Expand All @@ -444,7 +440,7 @@ extension WebxdcViewController: WKScriptMessageHandler {
logger.error("Failed to parse status update parameters \(message.body)")
return
}
_ = sendWebxdcStatusUpdate(payload: payloadString, description: description)
_ = dcContext.sendWebxdcStatusUpdate(msgId: messageId, payload: payloadString, description: description)

case .sendToChat:
if let dict = message.body as? [String: AnyObject] {
Expand Down

0 comments on commit b9eaeb3

Please sign in to comment.