Skip to content

Commit

Permalink
Check apps for validity (#2464)
Browse files Browse the repository at this point in the history
inspired by DcChat
  • Loading branch information
zeitschlag committed Jan 2, 2025
1 parent 42d49dc commit a367ff0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions deltachat-ios/Coordinator/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,13 @@ class AppCoordinator: NSObject {

let dcContext = dcAccounts.getSelected()
let dcMsg = dcContext.getMessage(id: messageId)
if dcMsg.type == DC_MSG_WEBXDC {
if dcMsg.isValid, dcMsg.type == DC_MSG_WEBXDC {
showChat(chatId: chatId, msgId: messageId, openHighlightedMsg: true, animated: false, clearViewControllerStack: true)
return true
} else {
showChats()
return false
}
return false
}

private func handleOpenChatDeeplink(url: URL) -> Bool {
Expand Down
4 changes: 4 additions & 0 deletions deltachat-ios/DC/DcMsg.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public class DcMsg {
return dc_msg_is_forwarded(messagePointer) != 0
}

public var isValid: Bool {
return messagePointer != nil
}

public var messageId: String {
return "\(id)"
}
Expand Down

0 comments on commit a367ff0

Please sign in to comment.