This patch is slightly large (I think still within the guidelines tho) , but also pretty straightforward. I thought for a while about how I could split this up in a straightforward way, and I couldn’t come up with anything without breaking intermediate builds. - Deleted a lot of old/unnecessary code (ie. the Collection extension for MuteItem, since we’re now using the MutelistManager sets) - Changed damus_state.contacts to damus_state.mutelist_manager for all mute list manager work - Updated MutelistView to take advantage of new code (this is probably the largest change in this patch) Lighting-Address: fishcharlie@strike.me Signed-off-by: Charlie Fish <contact@charlie.fish> Reviewed-by: William Casarin <jb55@jb55.com> Link: 20240210163650.42884-4-contact@charlie.fish Signed-off-by: William Casarin <jb55@jb55.com>
27 lines
769 B
Swift
27 lines
769 B
Swift
//
|
||
// HeadlessDamusState.swift
|
||
// damus
|
||
//
|
||
// Created by Daniel D’Aquino on 2023-11-27.
|
||
//
|
||
|
||
import Foundation
|
||
|
||
/// HeadlessDamusState
|
||
///
|
||
/// A protocl for a lighter headless alternative to DamusState that does not have dependencies on View objects or UI logic.
|
||
/// This is useful in limited environments (e.g. Notification Service Extension) where we do not want View/UI dependencies
|
||
protocol HeadlessDamusState {
|
||
var ndb: Ndb { get }
|
||
var settings: UserSettingsStore { get }
|
||
var contacts: Contacts { get }
|
||
var mutelist_manager: MutelistManager { get }
|
||
var keypair: Keypair { get }
|
||
var profiles: Profiles { get }
|
||
var zaps: Zaps { get }
|
||
var lnurls: LNUrls { get }
|
||
|
||
@discardableResult
|
||
func add_zap(zap: Zapping) -> Bool
|
||
}
|