Skip to content

Commit

Permalink
dc_get_securejoin_qr() returns invite links directly
Browse files Browse the repository at this point in the history
  • Loading branch information
r10s committed Nov 27, 2024
1 parent 83f7817 commit f92cf2a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions deltachat-ios/Helper/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,7 @@ struct Utils {
}

public static func getInviteLink(context: DcContext, chatId: Int) -> String? {
// convert `OPENPGP4FPR:FPR#a=ADDR&n=NAME&...` to `https://i.delta.chat/#FPR&a=ADDR&n=NAME&...`
if var data = context.getSecurejoinQr(chatId: chatId), let hashRange = data.range(of: "#") {
data.replaceSubrange(hashRange, with: "&")
if let schemeRange = data.range(of: "OPENPGP4FPR:") {
data.replaceSubrange(schemeRange, with: "https://" + inviteDomain + "/#")
return data
}
}
return nil
return context.getSecurejoinQr(chatId: chatId)
}

public static func share(message: DcMsg, parentViewController: UIViewController, sourceView: UIView? = nil, sourceItem: UIBarButtonItem? = nil) {
Expand Down

0 comments on commit f92cf2a

Please sign in to comment.