add guestbook and moderation

This commit is contained in:
2026-09-17 07:30:38 +07:00
parent d1b83fdc33
commit ea9abae554
7 changed files with 1196 additions and 58 deletions
+4
View File
@@ -118,6 +118,8 @@ pub struct CommunityState {
pub relays: Vec<RelayUrl>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub heads: Vec<EntityHead>,
#[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
pub banned: BTreeSet<PublicKey>,
pub added_at_ms: u64,
}
@@ -183,6 +185,7 @@ impl CommunityState {
channels,
relays,
heads,
banned: BTreeSet::new(),
added_at_ms,
})
}
@@ -200,6 +203,7 @@ impl CommunityState {
pub fn apply_fold(&mut self, fold: &ControlFold) {
self.heads = fold.floors.values().cloned().collect();
self.banned = fold.banned.clone();
if let Some(community) = &fold.community {
self.relays = community