Add OnlyZaps Mode

Changelog-Added: Add OnlyZaps mode: disable reactions, only zaps!
This commit is contained in:
William Casarin
2023-04-20 13:40:37 -07:00
parent 209f3e8759
commit ac82f1bc09
16 changed files with 107 additions and 75 deletions

View File

@@ -52,6 +52,11 @@ class Profile: Codable {
set_val(key, val)
}
var reactions: Bool? {
get { return get_val("reactions"); }
set(s) { set_val("reactions", s) }
}
var deleted: Bool? {
get { return get_val("deleted"); }
set(s) { set_val("deleted", s) }

View File

@@ -560,7 +560,7 @@ func make_first_contact_event(keypair: Keypair) -> NostrEvent? {
return ev
}
func make_metadata_event(keypair: Keypair, metadata: NostrMetadata) -> NostrEvent? {
func make_metadata_event(keypair: Keypair, metadata: Profile) -> NostrEvent? {
guard let privkey = keypair.privkey else {
return nil
}

View File

@@ -1,25 +0,0 @@
//
// NostrMetadata.swift
// damus
//
// Created by William Casarin on 2022-05-21.
//
import Foundation
struct NostrMetadata: Codable {
let display_name: String?
let name: String?
let about: String?
let website: String?
let nip05: String?
let picture: String?
let banner: String?
let lud06: String?
let lud16: String?
}
func create_account_to_metadata(_ model: CreateAccountModel) -> NostrMetadata {
return NostrMetadata(display_name: model.real_name, name: model.nick_name, about: model.about, website: nil, nip05: nil, picture: model.profile_image, banner: nil, lud06: nil, lud16: nil)
}