Add support for account deletion

As per apple guidelines

Changelog-Added: Added support for account deletion
This commit is contained in:
William Casarin
2023-01-30 13:26:04 -08:00
parent 9fa11118d3
commit e1578c0337
12 changed files with 102 additions and 12 deletions

View File

@@ -0,0 +1,22 @@
//
// AccountDeletion.swift
// damus
//
// Created by William Casarin on 2023-01-30.
//
import Foundation
func created_deleted_account_profile(keypair: FullKeypair) -> NostrEvent {
var profile = Profile()
profile.deleted = true
profile.about = "account deleted"
profile.name = "nobody"
let content = encode_json(profile)!
let ev = NostrEvent(content: content, pubkey: keypair.pubkey, kind: 0)
ev.id = calculate_event_id(ev: ev)
ev.sig = sign_event(privkey: keypair.privkey, ev: ev)
return ev
}

View File

@@ -95,6 +95,9 @@ extension Notification.Name {
static var new_unmutes: Notification.Name {
return Notification.Name("new_unmutes")
}
static var deleted_account: Notification.Name {
return Notification.Name("deleted_account")
}
}
func handle_notify(_ name: Notification.Name) -> NotificationCenter.Publisher {