botserv: ASSIGN / UNASSIGN a bot to a channel
A channel gains a typed assigned_bot (event-logged, snapshotted). ASSIGN <#channel> <bot> / UNASSIGN <#channel> is founder-gated (or admin oper). The engine reconcile now also diffs channel assignments against tracked bot memberships: a live bot IJOINs its assigned channels and PARTs unassigned ones (new ServiceJoin/ServicePart actions), at burst and after commands; a deleted bot's memberships are dropped. Engine test for join-on-assign / part-on-unassign.
This commit is contained in:
parent
f94b0afcd9
commit
b25870e14b
6 changed files with 170 additions and 4 deletions
|
|
@ -262,6 +262,8 @@ impl Protocol for InspIrcd {
|
|||
// SVSNICK <uid> <newnick> <nickts> — the new nick takes the current
|
||||
// time as its TS so it wins any collision resolution.
|
||||
NetAction::QuitUser { uid, reason } => vec![format!(":{} QUIT :{}", uid, reason)],
|
||||
NetAction::ServiceJoin { uid, channel } => vec![format!(":{} IJOIN {}", uid, channel)],
|
||||
NetAction::ServicePart { uid, channel } => vec![format!(":{} PART {}", uid, channel)],
|
||||
NetAction::ForceNick { uid, nick } => {
|
||||
let now = SystemTime::now().duration_since(UNIX_EPOCH).map(|d| d.as_secs()).unwrap_or(self.ts);
|
||||
vec![self.from_us(format!("SVSNICK {} {} {}", uid, nick, now))]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue