Rename the project to Echo (was fedserv)
Rebrand the daemon and workspace: the binary is now `echo`, every crate is `echo-*` (`echo-api` and the module crates), Rust imports use `echo_*`, the gRPC proto is `proto/echo.proto` with package `echo.v1`, and the log filter, gossip peer-name default, and on-disk store default (`echo.db.jsonl`) follow. Docs updated throughout. No behaviour change; crate directories and the config schema are untouched.
This commit is contained in:
parent
e7037572e5
commit
993f5b2eea
159 changed files with 660 additions and 660 deletions
|
|
@ -1,8 +1,8 @@
|
|||
[package]
|
||||
name = "fedserv-groupserv"
|
||||
name = "echo-groupserv"
|
||||
version = "0.0.1"
|
||||
edition = "2021"
|
||||
description = "GroupServ: user groups (!name) whose members can be granted channel access together."
|
||||
|
||||
[dependencies]
|
||||
fedserv-api = { path = "../../api" }
|
||||
echo-api = { path = "../../api" }
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use fedserv_api::{Sender, ServiceCtx, Store};
|
||||
use echo_api::{Sender, ServiceCtx, Store};
|
||||
|
||||
// ADD <!group> <account>: add a plain member (no flags). Needs founder or `f`.
|
||||
pub fn handle(me: &str, from: &Sender, name: Option<&str>, target: Option<&str>, ctx: &mut ServiceCtx, db: &mut dyn Store) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use fedserv_api::{Sender, ServiceCtx, Store};
|
||||
use echo_api::{Sender, ServiceCtx, Store};
|
||||
|
||||
// DEL <!group> <account>: remove a member. Needs founder or the `f` flag.
|
||||
pub fn handle(me: &str, from: &Sender, name: Option<&str>, target: Option<&str>, ctx: &mut ServiceCtx, db: &mut dyn Store) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use fedserv_api::{Sender, ServiceCtx, Store};
|
||||
use echo_api::{Sender, ServiceCtx, Store};
|
||||
|
||||
// DROP <!group>: delete a group. Founder only.
|
||||
pub fn handle(me: &str, from: &Sender, name: Option<&str>, ctx: &mut ServiceCtx, db: &mut dyn Store) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use fedserv_api::{apply_flags, Sender, ServiceCtx, Store, GROUP_FLAGS};
|
||||
use echo_api::{apply_flags, Sender, ServiceCtx, Store, GROUP_FLAGS};
|
||||
|
||||
// FLAGS <!group> [account [+/-flags]]: list, show, or change group-access flags.
|
||||
// Listing/showing is open; changing needs the founder or the `f` flag.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use fedserv_api::{Sender, ServiceCtx, Store};
|
||||
use echo_api::{Sender, ServiceCtx, Store};
|
||||
|
||||
// INFO <!group>: show a group's founder and member count.
|
||||
pub fn handle(me: &str, from: &Sender, name: Option<&str>, ctx: &mut ServiceCtx, db: &mut dyn Store) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//! `lib.rs` holds the dispatcher and the two shared guards; each command lives
|
||||
//! in its own file.
|
||||
|
||||
use fedserv_api::{NetView, Sender, Service, ServiceCtx, Store};
|
||||
use echo_api::{NetView, Sender, Service, ServiceCtx, Store};
|
||||
|
||||
#[path = "register.rs"]
|
||||
mod register;
|
||||
|
|
@ -68,7 +68,7 @@ fn account<'a>(me: &str, from: &'a Sender, ctx: &mut ServiceCtx) -> Option<&'a s
|
|||
}
|
||||
|
||||
// Whether `who` may manage `group` (founder, or holds the F/f flag).
|
||||
fn can_manage(group: &fedserv_api::GroupView, who: &str) -> bool {
|
||||
fn can_manage(group: &echo_api::GroupView, who: &str) -> bool {
|
||||
group.founder.eq_ignore_ascii_case(who)
|
||||
|| group.members.iter().any(|m| m.account.eq_ignore_ascii_case(who) && (m.flags.contains('F') || m.flags.contains('f')))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use fedserv_api::{Sender, ServiceCtx, Store};
|
||||
use echo_api::{Sender, ServiceCtx, Store};
|
||||
|
||||
// LIST: operators see every group; others see the ones they belong to.
|
||||
pub fn handle(me: &str, from: &Sender, ctx: &mut ServiceCtx, db: &mut dyn Store) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use fedserv_api::{Sender, ServiceCtx, Store};
|
||||
use echo_api::{Sender, ServiceCtx, Store};
|
||||
|
||||
// REGISTER <!group>: create a group with you as its founder.
|
||||
pub fn handle(me: &str, from: &Sender, name: Option<&str>, ctx: &mut ServiceCtx, db: &mut dyn Store) {
|
||||
|
|
@ -14,7 +14,7 @@ pub fn handle(me: &str, from: &Sender, name: Option<&str>, ctx: &mut ServiceCtx,
|
|||
let acc = acc.to_string();
|
||||
match db.group_register(name, &acc) {
|
||||
Ok(()) => ctx.notice(me, from.uid, format!("Group \x02{name}\x02 registered — you're the founder.")),
|
||||
Err(fedserv_api::ChanError::Exists) => ctx.notice(me, from.uid, format!("\x02{name}\x02 is already registered.")),
|
||||
Err(echo_api::ChanError::Exists) => ctx.notice(me, from.uid, format!("\x02{name}\x02 is already registered.")),
|
||||
Err(_) => ctx.notice(me, from.uid, "Sorry, that didn't work. Please try again in a moment."),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue