mute: adding filtering support for MuteItem events
This patch depends on: Receiving New Mute List Type
- Changes NewMutesNotify, NewUnmutesNotify & MuteNotify to use MuteItem instead of Pubkey
- Changes is_muted in Contacts.swift to take in a MuteItem instead of a Pubkey
- A lot of changes here were just modifying callers of that to accept the new parameter type
Related: https://github.com/damus-io/damus/issues/1718
Related: 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>
This commit is contained in:
committed by
William Casarin
parent
2861ee2c12
commit
61a9e44898
@@ -8,8 +8,8 @@
|
||||
import Foundation
|
||||
|
||||
struct MuteNotify: Notify {
|
||||
typealias Payload = Pubkey
|
||||
var payload: Payload
|
||||
typealias Payload = MuteItem
|
||||
var payload: MuteItem
|
||||
}
|
||||
|
||||
extension NotifyHandler {
|
||||
@@ -19,7 +19,7 @@ extension NotifyHandler {
|
||||
}
|
||||
|
||||
extension Notifications {
|
||||
static func mute(_ target: Pubkey) -> Notifications<MuteNotify> {
|
||||
static func mute(_ target: MuteItem) -> Notifications<MuteNotify> {
|
||||
.init(.init(payload: target))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
|
||||
struct NewMutesNotify: Notify {
|
||||
typealias Payload = Set<Pubkey>
|
||||
typealias Payload = Set<MuteItem>
|
||||
var payload: Payload
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ extension NotifyHandler {
|
||||
}
|
||||
|
||||
extension Notifications {
|
||||
static func new_mutes(_ pubkeys: Set<Pubkey>) -> Notifications<NewMutesNotify> {
|
||||
static func new_mutes(_ pubkeys: Set<MuteItem>) -> Notifications<NewMutesNotify> {
|
||||
.init(.init(payload: pubkeys))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Foundation
|
||||
|
||||
struct NewUnmutesNotify: Notify {
|
||||
typealias Payload = Set<Pubkey>
|
||||
typealias Payload = Set<MuteItem>
|
||||
var payload: Payload
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ extension NotifyHandler {
|
||||
}
|
||||
|
||||
extension Notifications {
|
||||
static func new_unmutes(_ pubkeys: Set<Pubkey>) -> Notifications<NewUnmutesNotify> {
|
||||
static func new_unmutes(_ pubkeys: Set<MuteItem>) -> Notifications<NewUnmutesNotify> {
|
||||
.init(.init(payload: pubkeys))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user