diff --git a/app/static/examples/blacklist.example.yml b/app/static/examples/blacklist.example.yml index 9cb9172..ac0eebf 100644 --- a/app/static/examples/blacklist.example.yml +++ b/app/static/examples/blacklist.example.yml @@ -11,6 +11,6 @@ permanent_blacklist_pubkeys: - db0c9b8acd6101adb9b281c5321f98f6eebb33c5719d230ed1870997538a9765 permanent_blacklist_npubs: - npub1x0r5gflnk2mn6h3c70nvnywpy2j46gzqwg6k7uw6fxswyz0md9qqnhshtn -mute_list_event_ids: -# - 76be64157af3e00cf50fae5fda63170cd4636065adf34960a4bec84a2022610b +mutelist_authors: + - 3fe0ab6cbdb7ee27148202249e3fb3b89423c6f6cda6ef43ea5057c3d93088e4 # mutelist Event MUST be stored in this relay for it to be retrieved. diff --git a/config/Blacklist.go b/config/Blacklist.go index faafc9b..b4320a7 100644 --- a/config/Blacklist.go +++ b/config/Blacklist.go @@ -205,7 +205,7 @@ func saveBlacklistConfig(blacklistConfig types.BlacklistConfig) error { } // FetchPubkeysFromLocalMuteList sends a REQ to the local relay for mute list events. -func FetchPubkeysFromLocalMuteList(localRelayURL string, muteListEventIDs []string) ([]string, error) { +func FetchPubkeysFromLocalMuteList(localRelayURL string, muteListAuthors []string) ([]string, error) { var wg sync.WaitGroup var mu sync.Mutex var allPubkeys []string @@ -226,7 +226,7 @@ func FetchPubkeysFromLocalMuteList(localRelayURL string, muteListEventIDs []stri // Create the REQ message to fetch the mute list events by IDs. req := []interface{}{"REQ", subscriptionID, map[string]interface{}{ - "ids": muteListEventIDs, + "authors": muteListAuthors, "kinds": []int{10000}, // Mute list events kind. }} diff --git a/config/types/blacklistConfig.go b/config/types/blacklistConfig.go index 1e7f849..fb7dc4a 100644 --- a/config/types/blacklistConfig.go +++ b/config/types/blacklistConfig.go @@ -8,5 +8,5 @@ type BlacklistConfig struct { TempBanDuration int `yaml:"temp_ban_duration"` PermanentBlacklistPubkeys []string `yaml:"permanent_blacklist_pubkeys"` PermanentBlacklistNpubs []string `yaml:"permanent_blacklist_npubs"` - MuteListEventIDs []string `yaml:"mute_list_event_ids"` + MuteListAuthors []string `yaml:"mutelist_authors"` } \ No newline at end of file diff --git a/server/handlers/event.go b/server/handlers/event.go index 7485816..cbbe1a0 100644 --- a/server/handlers/event.go +++ b/server/handlers/event.go @@ -111,9 +111,9 @@ if blacklistCfg == nil { } // Only proceed if there are mutelist event IDs specified -if len(blacklistCfg.MuteListEventIDs) > 0 { +if len(blacklistCfg.MuteListAuthors) > 0 { localRelayURL := fmt.Sprintf("ws://localhost%s", cfg.Server.Port) - mutelistedPubkeys, err := config.FetchPubkeysFromLocalMuteList(localRelayURL, blacklistCfg.MuteListEventIDs) + mutelistedPubkeys, err := config.FetchPubkeysFromLocalMuteList(localRelayURL, blacklistCfg.MuteListAuthors) if err != nil { fmt.Println("Error fetching pubkeys from mutelist:", err) response.SendNotice(ws, "", "Error fetching pubkeys from mutelist")