Skip to content

Commit

Permalink
Merge pull request #1334 from planetary-social/revert-1319-refactor-b…
Browse files Browse the repository at this point in the history
…ech32-tlv

Revert "Refactor Bech32 and TLV usage"
  • Loading branch information
mplorentz authored Jul 23, 2024
2 parents 48e4d76 + fae1691 commit b0e1d9e
Show file tree
Hide file tree
Showing 15 changed files with 96 additions and 115 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed deep linking to profiles and notes.
- Fixed issue where some nostr:nprofile references did not appear as links.
- Decode nprofile, nevent, and naddr NIP-19 entities.
- Refactor away direct usages of Bech32 and TLV and replace with NostrIdentifier (which still uses both).

## [0.1.20] - 2024-07-10Z

Expand Down
26 changes: 16 additions & 10 deletions Nos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
035729B02BE4167E005FEE85 /* NoteParserTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 035729A62BE4167E005FEE85 /* NoteParserTests.swift */; };
035729B12BE4167E005FEE85 /* ReportTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 035729A72BE4167E005FEE85 /* ReportTests.swift */; };
035729B22BE4167E005FEE85 /* SHA256KeyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 035729A82BE4167E005FEE85 /* SHA256KeyTests.swift */; };
035729B32BE4167E005FEE85 /* TLVElementTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 035729A92BE4167E005FEE85 /* TLVElementTests.swift */; };
035729B32BE4167E005FEE85 /* TLVTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 035729A92BE4167E005FEE85 /* TLVTests.swift */; };
035729B82BE416A6005FEE85 /* DirectMessageWrapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 035729B42BE416A6005FEE85 /* DirectMessageWrapperTests.swift */; };
035729B92BE416A6005FEE85 /* GiftWrapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 035729B52BE416A6005FEE85 /* GiftWrapperTests.swift */; };
035729BA2BE416A6005FEE85 /* ReportPublisherTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 035729B62BE416A6005FEE85 /* ReportPublisherTests.swift */; };
Expand Down Expand Up @@ -95,6 +95,7 @@
3FFB1D9729A6BBEC002A755D /* Collection+SafeSubscript.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFB1D9529A6BBEC002A755D /* Collection+SafeSubscript.swift */; };
3FFB1D9C29A7DF9D002A755D /* StackedAvatarsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFB1D9B29A7DF9D002A755D /* StackedAvatarsView.swift */; };
3FFF3BD029A9645F00DD0B72 /* AuthorReference+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F43C47529A9625700E896A0 /* AuthorReference+CoreDataClass.swift */; };
5B08A1E12A1FDFF700EB8F2E /* TLV.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B8B77182A1FDA3C004FC675 /* TLV.swift */; };
5B098DBC2BDAF6CB00500A1B /* NoteParserTests+NIP08.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B098DBB2BDAF6CB00500A1B /* NoteParserTests+NIP08.swift */; };
5B098DC62BDAF73500500A1B /* AttributedString+Links.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B098DC52BDAF73500500A1B /* AttributedString+Links.swift */; };
5B098DC72BDAF77400500A1B /* AttributedString+Links.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B098DC52BDAF73500500A1B /* AttributedString+Links.swift */; };
Expand Down Expand Up @@ -123,6 +124,7 @@
5B834F692A83FC7F000C1432 /* ProfileSocialStatsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B834F682A83FC7F000C1432 /* ProfileSocialStatsView.swift */; };
5B88051A2A21027C00E21F06 /* SHA256Key.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B8805192A21027C00E21F06 /* SHA256Key.swift */; };
5B88051D2A2104CC00E21F06 /* SHA256Key.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B8805192A21027C00E21F06 /* SHA256Key.swift */; };
5B8B77192A1FDA3C004FC675 /* TLV.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B8B77182A1FDA3C004FC675 /* TLV.swift */; };
5B8C96AC29D52AD200B73AEC /* AuthorListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B8C96AB29D52AD200B73AEC /* AuthorListView.swift */; };
5B8C96B029DB2E1100B73AEC /* SearchTextFieldObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B8C96AF29DB2E1100B73AEC /* SearchTextFieldObserver.swift */; };
5B8C96B229DB313300B73AEC /* AuthorCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B8C96B129DB313300B73AEC /* AuthorCard.swift */; };
Expand Down Expand Up @@ -452,8 +454,8 @@
C9F0BB6B29A503D6000547FC /* PublicKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9F0BB6A29A503D6000547FC /* PublicKey.swift */; };
C9F0BB6C29A503D6000547FC /* PublicKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9F0BB6A29A503D6000547FC /* PublicKey.swift */; };
C9F0BB6D29A503D9000547FC /* Int+Bool.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9F0BB6829A5039D000547FC /* Int+Bool.swift */; };
C9F0BB6F29A50437000547FC /* NostrIdentifierPrefix.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9F0BB6E29A50437000547FC /* NostrIdentifierPrefix.swift */; };
C9F0BB7029A50437000547FC /* NostrIdentifierPrefix.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9F0BB6E29A50437000547FC /* NostrIdentifierPrefix.swift */; };
C9F0BB6F29A50437000547FC /* NostrConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9F0BB6E29A50437000547FC /* NostrConstants.swift */; };
C9F0BB7029A50437000547FC /* NostrConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9F0BB6E29A50437000547FC /* NostrConstants.swift */; };
C9F204672ADEDBA80029A858 /* String+Extra.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9F204662ADEDBA80029A858 /* String+Extra.swift */; };
C9F204802AE029D90029A858 /* AppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9F2047F2AE029D90029A858 /* AppDestination.swift */; };
C9F204812AE02D8C0029A858 /* AppDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9F2047F2AE029D90029A858 /* AppDestination.swift */; };
Expand Down Expand Up @@ -537,7 +539,7 @@
035729A62BE4167E005FEE85 /* NoteParserTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NoteParserTests.swift; sourceTree = "<group>"; };
035729A72BE4167E005FEE85 /* ReportTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReportTests.swift; sourceTree = "<group>"; };
035729A82BE4167E005FEE85 /* SHA256KeyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SHA256KeyTests.swift; sourceTree = "<group>"; };
035729A92BE4167E005FEE85 /* TLVElementTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLVElementTests.swift; sourceTree = "<group>"; };
035729A92BE4167E005FEE85 /* TLVTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLVTests.swift; sourceTree = "<group>"; };
035729B42BE416A6005FEE85 /* DirectMessageWrapperTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DirectMessageWrapperTests.swift; sourceTree = "<group>"; };
035729B52BE416A6005FEE85 /* GiftWrapperTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GiftWrapperTests.swift; sourceTree = "<group>"; };
035729B62BE416A6005FEE85 /* ReportPublisherTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReportPublisherTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -605,6 +607,7 @@
5B834F662A83FB5C000C1432 /* ProfileKnownFollowersView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileKnownFollowersView.swift; sourceTree = "<group>"; };
5B834F682A83FC7F000C1432 /* ProfileSocialStatsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileSocialStatsView.swift; sourceTree = "<group>"; };
5B8805192A21027C00E21F06 /* SHA256Key.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SHA256Key.swift; sourceTree = "<group>"; };
5B8B77182A1FDA3C004FC675 /* TLV.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TLV.swift; sourceTree = "<group>"; };
5B8C96AB29D52AD200B73AEC /* AuthorListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthorListView.swift; sourceTree = "<group>"; };
5B8C96AF29DB2E1100B73AEC /* SearchTextFieldObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchTextFieldObserver.swift; sourceTree = "<group>"; };
5B8C96B129DB313300B73AEC /* AuthorCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthorCard.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -841,7 +844,7 @@
C9EF84CE2C24D63000182B6F /* MockRelayService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockRelayService.swift; sourceTree = "<group>"; };
C9F0BB6829A5039D000547FC /* Int+Bool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Int+Bool.swift"; sourceTree = "<group>"; };
C9F0BB6A29A503D6000547FC /* PublicKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicKey.swift; sourceTree = "<group>"; };
C9F0BB6E29A50437000547FC /* NostrIdentifierPrefix.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NostrIdentifierPrefix.swift; sourceTree = "<group>"; };
C9F0BB6E29A50437000547FC /* NostrConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NostrConstants.swift; sourceTree = "<group>"; };
C9F204662ADEDBA80029A858 /* String+Extra.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Extra.swift"; sourceTree = "<group>"; };
C9F2047F2AE029D90029A858 /* AppDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDestination.swift; sourceTree = "<group>"; };
C9F64D8B29ED840700563F2B /* Zipper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Zipper.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -994,6 +997,7 @@
035729A62BE4167E005FEE85 /* NoteParserTests.swift */,
035729A72BE4167E005FEE85 /* ReportTests.swift */,
035729A82BE4167E005FEE85 /* SHA256KeyTests.swift */,
035729A92BE4167E005FEE85 /* TLVTests.swift */,
03ED93462C46C48400C8D443 /* JSONEventTests.swift */,
);
path = Models;
Expand Down Expand Up @@ -1028,7 +1032,6 @@
isa = PBXGroup;
children = (
0376DF612C3DBAED00C80786 /* NostrIdentifierTests.swift */,
035729A92BE4167E005FEE85 /* TLVElementTests.swift */,
);
path = NostrIdentifier;
sourceTree = "<group>";
Expand All @@ -1051,7 +1054,6 @@
isa = PBXGroup;
children = (
03D1B4272C3C1A5D001778CD /* NostrIdentifier.swift */,
C9F0BB6E29A50437000547FC /* NostrIdentifierPrefix.swift */,
03D1B42B2C3C1B0D001778CD /* TLVElement.swift */,
);
path = NostrIdentifier;
Expand Down Expand Up @@ -1247,6 +1249,7 @@
C9A8015D2BD0177D006E29B2 /* ReportPublisher.swift */,
5B8805192A21027C00E21F06 /* SHA256Key.swift */,
C9B678E029EEC41000303F33 /* SocialGraphCache.swift */,
5B8B77182A1FDA3C004FC675 /* TLV.swift */,
C9A0DAF729C92F4500466635 /* UNSAPI.swift */,
C9F64D8B29ED840700563F2B /* Zipper.swift */,
032634512C10BB8F00E489B5 /* FileStorage */,
Expand Down Expand Up @@ -1470,6 +1473,7 @@
C9F84C26298DC98800C6714D /* KeyPair.swift */,
C930055E2A6AF8320098CA9E /* LoadingContent.swift */,
C90352B92C1235CD000A5993 /* NosNavigationDestination.swift */,
C9F0BB6E29A50437000547FC /* NostrConstants.swift */,
5B6EB48D29EDBE0E006E750C /* NoteParser.swift */,
C9AC31AC2A55E0BD00A94E5A /* NotificationViewModel.swift */,
C9CF23162A38A58B00EBEC31 /* ParseQueue.swift */,
Expand Down Expand Up @@ -2021,7 +2025,7 @@
5B8C96B629DDD3B200B73AEC /* NoteTextViewRepresentable.swift in Sources */,
C93EC2F129C337EB0012EE2A /* RelayPicker.swift in Sources */,
5BBA5E912BADF98E00D57D76 /* AlreadyHaveANIP05View.swift in Sources */,
C9F0BB6F29A50437000547FC /* NostrIdentifierPrefix.swift in Sources */,
C9F0BB6F29A50437000547FC /* NostrConstants.swift in Sources */,
C96D39272B61B6D200D3D0A1 /* RawNostrID.swift in Sources */,
C996933E2C11FF0F00A2C70D /* EventObservationView.swift in Sources */,
5BFF66B12A573F6400AA79DD /* RelayDetailView.swift in Sources */,
Expand Down Expand Up @@ -2145,6 +2149,7 @@
5B503F622A291A1A0098805A /* JSONRelayMetadata.swift in Sources */,
C98298332ADD7F9A0096C5B5 /* DeepLinkService.swift in Sources */,
03F7C4F42C10E05B006FF613 /* URLSessionProtocol.swift in Sources */,
5B8B77192A1FDA3C004FC675 /* TLV.swift in Sources */,
CD09A74829A51EFC0063464F /* Router.swift in Sources */,
2D4010A22AD87DF300F93AD4 /* KnownFollowersView.swift in Sources */,
CD2CF38E299E67F900332116 /* CardButtonStyle.swift in Sources */,
Expand Down Expand Up @@ -2181,6 +2186,7 @@
C9EF84D02C24D63000182B6F /* MockRelayService.swift in Sources */,
CD09A76029A521FD0063464F /* Filter.swift in Sources */,
C9B71DC32A9003670031ED9F /* CrashReporting.swift in Sources */,
5B08A1E12A1FDFF700EB8F2E /* TLV.swift in Sources */,
C9C2B78329E0735400548B4A /* RelaySubscriptionManager.swift in Sources */,
C9C2B78029E0731600548B4A /* AsyncTimer.swift in Sources */,
C96D39282B61B6D200D3D0A1 /* RawNostrID.swift in Sources */,
Expand All @@ -2190,7 +2196,7 @@
C936B45F2A4CAF2B00DF1EB9 /* AppDelegate.swift in Sources */,
C96D391B2B61AFD500D3D0A1 /* RawNostrIDTests.swift in Sources */,
035729AD2BE4167E005FEE85 /* EventTests.swift in Sources */,
035729B32BE4167E005FEE85 /* TLVElementTests.swift in Sources */,
035729B32BE4167E005FEE85 /* TLVTests.swift in Sources */,
C9C2B77D29E072E400548B4A /* WebSocket+Nos.swift in Sources */,
C973AB642A323167002AED16 /* Relay+CoreDataProperties.swift in Sources */,
C9EE3E642A053910008A7491 /* ExpirationTimeOption.swift in Sources */,
Expand Down Expand Up @@ -2282,7 +2288,7 @@
C93EC2F529C34C860012EE2A /* NSPredicate+Bool.swift in Sources */,
C9DEC05B298950A90078B43A /* String+Lorem.swift in Sources */,
C9F84C1D298DBC6100C6714D /* Data+Sha.swift in Sources */,
C9F0BB7029A50437000547FC /* NostrIdentifierPrefix.swift in Sources */,
C9F0BB7029A50437000547FC /* NostrConstants.swift in Sources */,
03B4E6AF2C125D61006E5F59 /* FileStorageUploadResponseJSON.swift in Sources */,
A3B943D8299D758F00A15A08 /* Keychain.swift in Sources */,
035729B92BE416A6005FEE85 /* GiftWrapperTests.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion Nos/Models/CoreData/Event+CoreDataClass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ public class Event: NosManagedObject, VerifiableEvent {
let identifierBytes = try? identifier.bytes else {
return nil
}
return Bech32.encode(NostrIdentifierPrefix.note, baseEightData: Data(identifierBytes))
return Bech32.encode(Nostr.notePrefix, baseEightData: Data(identifierBytes))
}

var seenOnRelayURLs: [String] {
Expand Down
17 changes: 11 additions & 6 deletions Nos/Models/KeyPair.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct KeyPair {
}

var nsec: String {
Bech32.encode(NostrIdentifierPrefix.privateKey, baseEightData: underlyingKey.dataRepresentation)
Bech32.encode(Nostr.privateKeyPrefix, baseEightData: underlyingKey.dataRepresentation)
}

var npub: String {
Expand Down Expand Up @@ -53,15 +53,20 @@ struct KeyPair {

init?(nsec: String) {
do {
let identifier = try NostrIdentifier.decode(bech32String: nsec)
guard case let .nsec(privateKeyHex) = identifier else {
print("Error decoding nsec")
let (humanReadablePart, checksum) = try Bech32.decode(nsec)
guard humanReadablePart == Nostr.privateKeyPrefix else {
print("error creating KeyPair from nsec: invalid human readable part")
return nil
}
self.underlyingKey = try .init(dataRepresentation: privateKeyHex.bytes)

guard let converted = try? checksum.base8FromBase5() else {
return nil
}

self.underlyingKey = try .init(dataRepresentation: converted)
publicKey = PublicKey(underlyingKey: underlyingKey.publicKey.xonly)
} catch {
print("Error creating KeyPair: \(error.localizedDescription)")
print("error creating KeyPair \(error.localizedDescription)")
return nil
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ import Foundation

/// A collection of constants used in Nostr.
/// Note: See [NIP-19](https://github.com/nostr-protocol/nips/blob/master/19.md) for details.
enum NostrIdentifierPrefix {
enum Nostr {
/// The Bech32 prefix for a private key.
static let privateKey = "nsec"
static let privateKeyPrefix = "nsec"

/// The Bech32 prefix for a public key.
static let publicKey = "npub"
static let publicKeyPrefix = "npub"

/// The Bech32 prefix for note ID.
static let note = "note"
static let notePrefix = "note"

/// The Bech32 prefix for a nostr profile.
static let profile = "nprofile"
static let profilePrefix = "nprofile"

/// The Bech32 prefix for a nostr event.
static let event = "nevent"
static let eventPrefix = "nevent"

/// The Bech32 prefix for a nostr replaceable event coordinate, or address.
static let address = "naddr"
static let addressPrefix = "naddr"
}
2 changes: 0 additions & 2 deletions Nos/Models/NoteParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ struct NoteParser {
case .naddr(let replaceableID, _, let authorID, let kind):
return "\(prefix)[\(String(localized: .localizable.linkToNote))]" +
"($\(replaceableID);\(authorID);\(kind))"
case .nsec:
return String(substring)
}
} catch {
return String(substring)
Expand Down
18 changes: 11 additions & 7 deletions Nos/Models/PublicKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,25 @@ struct PublicKey {
}

init?(npub: String) {
self.init(bech32Encoded: npub, prefix: NostrIdentifierPrefix.publicKey)
self.init(bech32Encoded: npub, prefix: Nostr.publicKeyPrefix)
}

init?(note: String) {
self.init(bech32Encoded: note, prefix: NostrIdentifierPrefix.note)
self.init(bech32Encoded: note, prefix: Nostr.notePrefix)
}

private init?(bech32Encoded: String, prefix: String) {
do {
let identifier = try NostrIdentifier.decode(bech32String: bech32Encoded)
guard case let .npub(publicKeyHex) = identifier else {
print("Error decoding npub")
let (humanReadablePart, checksum) = try Bech32.decode(bech32Encoded)
guard humanReadablePart == prefix else {
print("error creating PublicKey: invalid human readable part")
return nil
}
let underlyingKey = try secp256k1.Signing.XonlyKey(dataRepresentation: publicKeyHex.bytes, keyParity: 0)
guard let converted = try? checksum.base8FromBase5() else {
return nil
}

let underlyingKey = secp256k1.Signing.XonlyKey(dataRepresentation: converted, keyParity: 0)
self.init(underlyingKey: underlyingKey)
} catch {
print("error creating PublicKey \(error.localizedDescription)")
Expand All @@ -62,7 +66,7 @@ struct PublicKey {
init(underlyingKey: secp256k1.Signing.XonlyKey) {
self.underlyingKey = underlyingKey
self.hex = Data(underlyingKey.bytes).hexString
self.npub = Bech32.encode(NostrIdentifierPrefix.publicKey, baseEightData: Data(underlyingKey.bytes))
self.npub = Bech32.encode(Nostr.publicKeyPrefix, baseEightData: Data(underlyingKey.bytes))
self.bytes = underlyingKey.bytes
}
}
3 changes: 0 additions & 3 deletions Nos/Router.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@ extension Router {
}
let replaceableID = parts.dropLast(2).joined(separator: separator)
pushNote(replaceableID: replaceableID, authorID: authorID, kind: kind)
} else if let scheme = url.scheme,
DeepLinkService.supportedURLSchemes.contains(scheme) {
DeepLinkService.handle(url, router: self)
} else if url.scheme == "http" || url.scheme == "https" {
push(url)
} else {
Expand Down
2 changes: 0 additions & 2 deletions Nos/Service/DeepLinkService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ enum DeepLinkService {
authorID: authorID,
kind: Int64(kind)
)
case .nsec:
break
}
}
} catch {
Expand Down
Loading

0 comments on commit b0e1d9e

Please sign in to comment.