Choose Participants on a Thread Reply

Closes: #345
Changelog-Added: Add the ability to choose participants when replying
This commit is contained in:
Joel Klabo
2023-01-22 10:08:50 -08:00
committed by William Casarin
parent 5e9580377d
commit 2a9ddd10c8
4 changed files with 122 additions and 6 deletions

View File

@@ -790,6 +790,7 @@ func inner_event_or_self(ev: NostrEvent) -> NostrEvent {
return inner_ev
}
<<<<<<< HEAD
func first_eref_mention(ev: NostrEvent, privkey: String?) -> Mention? {
let blocks = ev.blocks(privkey).filter { block in
@@ -815,3 +816,21 @@ func first_eref_mention(ev: NostrEvent, privkey: String?) -> Mention? {
return nil
}
extension [ReferencedId] {
var pRefs: [ReferencedId] {
get {
self.filter { ref in
ref.key == "p"
}
}
}
var eRefs: [ReferencedId] {
get {
self.filter { ref in
ref.key == "e"
}
}
}
}