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:
Charlie Fish
2024-01-17 18:17:40 -07:00
committed by William Casarin
parent 2861ee2c12
commit 61a9e44898
11 changed files with 43 additions and 49 deletions
+2 -2
View File
@@ -179,7 +179,7 @@ struct ProfileView: View {
notify(.report(.user(profile.pubkey)))
}
if damus_state.contacts.is_muted(profile.pubkey) {
if damus_state.contacts.is_muted(.user(profile.pubkey, nil)) {
Button(NSLocalizedString("Unmute", comment: "Button to unmute a profile.")) {
guard
let keypair = damus_state.keypair.to_full(),
@@ -197,7 +197,7 @@ struct ProfileView: View {
}
} else {
Button(NSLocalizedString("Mute", comment: "Button to mute a profile."), role: .destructive) {
notify(.mute(profile.pubkey))
notify(.mute(.user(profile.pubkey, nil)))
}
}
}