This patch depends on: Adding ability to mute hashtag from SearchView This is the last patch for the new mute list feature - Removing MutedThreadsManager - Adding system to migrate existing muted threads to new mute list Closes: https://github.com/damus-io/damus/issues/1718 Closes: https://github.com/damus-io/damus/issues/856 Lighting Address: fishcharlie@strike.me Signed-off-by: Charlie Fish <contact@charlie.fish> Reviewed-by: William Casarin <jb55@jb55.com> Signed-off-by: William Casarin <jb55@jb55.com>
44 lines
1.1 KiB
Swift
44 lines
1.1 KiB
Swift
//
|
||
// NotificationExtensionState.swift
|
||
// DamusNotificationService
|
||
//
|
||
// Created by Daniel D’Aquino on 2023-11-27.
|
||
//
|
||
|
||
import Foundation
|
||
|
||
struct NotificationExtensionState: HeadlessDamusState {
|
||
let ndb: Ndb
|
||
let settings: UserSettingsStore
|
||
let contacts: Contacts
|
||
let keypair: Keypair
|
||
let profiles: Profiles
|
||
let zaps: Zaps
|
||
let lnurls: LNUrls
|
||
|
||
init?() {
|
||
guard let ndb = try? Ndb(owns_db_file: false) else { return nil }
|
||
self.ndb = ndb
|
||
|
||
guard let keypair = get_saved_keypair() else { return nil }
|
||
|
||
// dumb stuff needed for property wrappers
|
||
UserSettingsStore.pubkey = keypair.pubkey
|
||
self.settings = UserSettingsStore()
|
||
|
||
self.contacts = Contacts(our_pubkey: keypair.pubkey)
|
||
self.keypair = keypair
|
||
self.profiles = Profiles(ndb: ndb)
|
||
self.zaps = Zaps(our_pubkey: keypair.pubkey)
|
||
self.lnurls = LNUrls()
|
||
}
|
||
|
||
@discardableResult
|
||
func add_zap(zap: Zapping) -> Bool {
|
||
// store generic zap mapping
|
||
self.zaps.add_zap(zap: zap)
|
||
|
||
return true
|
||
}
|
||
}
|