Add the ability to unlike posts

Changelog-Added: Add ability to unlike posts
Closes: #580
This commit is contained in:
Oleg Gordiichuk
2023-02-12 22:45:47 +01:00
committed by William Casarin
parent 4f86361b63
commit 237c939639
5 changed files with 59 additions and 7 deletions

View File

@@ -578,6 +578,16 @@ func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> Nost
return ev
}
func make_delete_event(pubkey: String, privkey: String, deleted_events: Set<String>) -> NostrEvent {
let tags: [[String]] = deleted_events.map{["e", $0]}
let ev = NostrEvent(content: "Content delete", pubkey: pubkey, kind: NostrKind.delete.rawValue, tags: tags)
ev.calculate_id()
ev.sign(privkey: privkey)
return ev
}
func zap_target_to_tags(_ target: ZapTarget) -> [[String]] {
switch target {
case .profile(let pk):