Compare commits
9 Commits
translatio
...
tyiu/nip05
| Author | SHA1 | Date | |
|---|---|---|---|
|
c1e5787120
|
|||
|
|
0b40cd127c | ||
|
|
754ee254e9 | ||
|
|
963cb37762 | ||
|
|
159d0fa2b5 | ||
|
|
61fddf800e | ||
|
|
b6d5b6f45e | ||
|
|
f5ed9cd5d4 | ||
|
|
57006b928b |
@@ -94,6 +94,14 @@ enum Block {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var is_note_mention: Bool {
|
||||||
|
guard case .mention(let mention) = self else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return mention.type == .event
|
||||||
|
}
|
||||||
|
|
||||||
var is_mention: Bool {
|
var is_mention: Bool {
|
||||||
if case .mention = self {
|
if case .mention = self {
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
import Combine
|
||||||
|
|
||||||
let PPM_SIZE: CGFloat = 80.0
|
let PPM_SIZE: CGFloat = 80.0
|
||||||
let BANNER_HEIGHT: CGFloat = 150.0;
|
let BANNER_HEIGHT: CGFloat = 150.0;
|
||||||
@@ -196,6 +197,9 @@ struct EditMetadataView: View {
|
|||||||
TextField(NSLocalizedString("jb55@jb55.com", comment: "Placeholder example text for identifier used for NIP-05 verification."), text: $nip05)
|
TextField(NSLocalizedString("jb55@jb55.com", comment: "Placeholder example text for identifier used for NIP-05 verification."), text: $nip05)
|
||||||
.autocorrectionDisabled(true)
|
.autocorrectionDisabled(true)
|
||||||
.textInputAutocapitalization(.never)
|
.textInputAutocapitalization(.never)
|
||||||
|
.onReceive(Just(nip05)) { newValue in
|
||||||
|
self.nip05 = newValue.trimmingCharacters(in: .whitespaces)
|
||||||
|
}
|
||||||
}, header: {
|
}, header: {
|
||||||
Text("NIP-05 Verification", comment: "Label for NIP-05 Verification section of user profile form.")
|
Text("NIP-05 Verification", comment: "Label for NIP-05 Verification section of user profile form.")
|
||||||
}, footer: {
|
}, footer: {
|
||||||
|
|||||||
@@ -240,6 +240,7 @@ struct NoteArtifacts {
|
|||||||
|
|
||||||
func render_note_content(ev: NostrEvent, profiles: Profiles, privkey: String?) -> NoteArtifacts {
|
func render_note_content(ev: NostrEvent, profiles: Profiles, privkey: String?) -> NoteArtifacts {
|
||||||
let blocks = ev.blocks(privkey)
|
let blocks = ev.blocks(privkey)
|
||||||
|
|
||||||
return render_blocks(blocks: blocks, profiles: profiles, privkey: privkey)
|
return render_blocks(blocks: blocks, profiles: profiles, privkey: privkey)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,9 +248,17 @@ func render_blocks(blocks: [Block], profiles: Profiles, privkey: String?) -> Not
|
|||||||
var invoices: [Invoice] = []
|
var invoices: [Invoice] = []
|
||||||
var img_urls: [URL] = []
|
var img_urls: [URL] = []
|
||||||
var link_urls: [URL] = []
|
var link_urls: [URL] = []
|
||||||
|
|
||||||
|
let one_note_ref = blocks
|
||||||
|
.filter({ $0.is_note_mention })
|
||||||
|
.count == 1
|
||||||
|
|
||||||
let txt: AttributedString = blocks.reduce("") { str, block in
|
let txt: AttributedString = blocks.reduce("") { str, block in
|
||||||
switch block {
|
switch block {
|
||||||
case .mention(let m):
|
case .mention(let m):
|
||||||
|
if m.type == .event && one_note_ref {
|
||||||
|
return str
|
||||||
|
}
|
||||||
return str + mention_str(m, profiles: profiles)
|
return str + mention_str(m, profiles: profiles)
|
||||||
case .text(let txt):
|
case .text(let txt):
|
||||||
return str + AttributedString(stringLiteral: txt)
|
return str + AttributedString(stringLiteral: txt)
|
||||||
|
|||||||
@@ -42,10 +42,10 @@ struct InnerTimelineView: View {
|
|||||||
nav_target = ev.inner_event ?? ev
|
nav_target = ev.inner_event ?? ev
|
||||||
navigating = true
|
navigating = true
|
||||||
}
|
}
|
||||||
.padding(.top, 10)
|
.padding(.top, 7)
|
||||||
|
|
||||||
Divider()
|
Divider()
|
||||||
.padding([.top], 10)
|
.padding([.top], 7)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user