-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
128 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use enostr::Pubkey; | ||
use std::collections::BTreeSet; | ||
|
||
#[derive(Default)] | ||
pub struct Muted { | ||
// TODO - implement private mutes | ||
pub pubkeys: BTreeSet<Pubkey>, | ||
pub hashtags: BTreeSet<String>, | ||
pub words: BTreeSet<String>, | ||
pub threads: BTreeSet<[u8; 32]>, | ||
} | ||
|
||
impl std::fmt::Debug for Muted { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
let threads_hex: Vec<String> = self.threads.iter().map(hex::encode).collect(); | ||
f.debug_struct("Muted") | ||
.field("pubkeys", &self.pubkeys) | ||
.field("hashtags", &self.hashtags) | ||
.field("words", &self.words) | ||
.field("threads", &threads_hex) | ||
.finish() | ||
} | ||
} |