From cb68bdf4468aae726a0175c21baf95c37394a517 Mon Sep 17 00:00:00 2001 From: Lumaa Date: Fri, 16 Feb 2024 17:20:13 +0100 Subject: [PATCH] Other client URIs --- Threaded.xcodeproj/project.pbxproj | 4 +++ Threaded/Data/AltClients.swift | 50 ++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 Threaded/Data/AltClients.swift diff --git a/Threaded.xcodeproj/project.pbxproj b/Threaded.xcodeproj/project.pbxproj index d956f3b..5146661 100644 --- a/Threaded.xcodeproj/project.pbxproj +++ b/Threaded.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ B915C4422B6F908C00042DDB /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B915C4412B6F908C00042DDB /* ProfileView.swift */; }; + B93757112B7FB8D400652F91 /* AltClients.swift in Sources */ = {isa = PBXBuildFile; fileRef = B93757102B7FB8D400652F91 /* AltClients.swift */; }; B93ADFCB2B7625CD00FF9172 /* DiscoveryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B93ADFCA2B7625CD00FF9172 /* DiscoveryView.swift */; }; B93B676D2B42C94F000892E9 /* Nuke in Frameworks */ = {isa = PBXBuildFile; productRef = B93B676C2B42C94F000892E9 /* Nuke */; }; B93B676F2B42C94F000892E9 /* NukeExtensions in Frameworks */ = {isa = PBXBuildFile; productRef = B93B676E2B42C94F000892E9 /* NukeExtensions */; }; @@ -117,6 +118,7 @@ /* Begin PBXFileReference section */ B915C4412B6F908C00042DDB /* ProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileView.swift; sourceTree = ""; }; + B93757102B7FB8D400652F91 /* AltClients.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AltClients.swift; sourceTree = ""; }; B93ADFCA2B7625CD00FF9172 /* DiscoveryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscoveryView.swift; sourceTree = ""; }; B93B67772B42E8F0000892E9 /* TextEmoji.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextEmoji.swift; sourceTree = ""; }; B93B67792B42EC51000892E9 /* MetaPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MetaPicker.swift; sourceTree = ""; }; @@ -332,6 +334,7 @@ B9FB949C2B2EF0D600D81C07 /* Instance.swift */, B9FB949E2B2EF0F200D81C07 /* MastodonRequest.swift */, B97BCE232B3DD8400044756D /* HapticManager.swift */, + B93757102B7FB8D400652F91 /* AltClients.swift */, ); path = Data; sourceTree = ""; @@ -580,6 +583,7 @@ B9DC692B2B78E60300E625B9 /* PostsView.swift in Sources */, B9FB94BC2B2F035500D81C07 /* Tag.swift in Sources */, B9BED51A2B5D662D00C9B715 /* ShareSheetController.swift in Sources */, + B93757112B7FB8D400652F91 /* AltClients.swift in Sources */, B9BED5162B5D5E6500C9B715 /* PostInteractor.swift in Sources */, B98BC74B2B46CF0400595441 /* ThreadedStyle.swift in Sources */, B9FB94812B2E1FEF00D81C07 /* HTMLString.swift in Sources */, diff --git a/Threaded/Data/AltClients.swift b/Threaded/Data/AltClients.swift new file mode 100644 index 0000000..2bb6843 --- /dev/null +++ b/Threaded/Data/AltClients.swift @@ -0,0 +1,50 @@ +//Made by Lumaa + +/// All other Mastodon clients' URIs found +final class AltClients { + + // - Official iOS Mastodon client by Mastodon + struct OfficialMastodon { + static let `default` = "mastodon://" + + static let post = "\(Self.default)post" + static let search = "\(Self.default)search?query=Threaded" // query feature does not work? + + static func status(id: String) -> String { + return "\(Self.default)status/\(id)" + } + + static func profile(account: Account) -> String { + return "\(Self.default)status/\(account.acct)" + } + + static func profile(acct: String) -> String { + return "\(Self.default)status/\(acct)" + } + } + + // - IcesCubesApp by Dimillian, open-source + struct IceCubesApp { + static let `default` = "icecubesapp://" + + static func profile(server: String, username: String) -> String { + return "\(Self.default)\(server)/@\(username)" + } + + static func profile(account: Account) -> String { + let url = account.url?.absoluteString.replacingOccurrences(of: "https://", with: Self.default) + return url ?? Self.default + } + + static func status(_ status: Status) -> String { + return Self.profile(account: status.account) + "/\(status.id)" + } + } + + // - Ivory by Tapbots + struct IvoryApp { + static let `default` = "ivory://" + + // Others found don't work? Maybe because of demo + } +}