link: rework s2s wire format to the standard v4 server protocol (10-field uid, letters-comma fjoin, ijoin, timestamped fmode, ftopic, uuid kick) so external services link
This commit is contained in:
parent
f921c2eb9c
commit
1c8799d785
5 changed files with 415 additions and 116 deletions
|
|
@ -159,6 +159,32 @@ impl Member {
|
|||
self.held().iter().map(|(_, s)| *s).collect()
|
||||
}
|
||||
}
|
||||
|
||||
/// Every status mode *letter* this member holds (`o`, `v`, custom letters),
|
||||
/// high→low. The server-to-server membership burst lists members as
|
||||
/// `<letters>,<uuid>`, so this is the letter form of `all_prefixes`.
|
||||
pub fn mode_letters(&self) -> String {
|
||||
use crate::modules::customprefix::def_for_letter;
|
||||
let mut s = String::new();
|
||||
for (on, l) in [
|
||||
(self.oprefix, 'y'),
|
||||
(self.owner, 'q'),
|
||||
(self.admin, 'a'),
|
||||
(self.op, 'o'),
|
||||
(self.halfop, 'h'),
|
||||
(self.voice, 'v'),
|
||||
] {
|
||||
if on {
|
||||
s.push(l);
|
||||
}
|
||||
}
|
||||
for &c in &self.custom_prefixes {
|
||||
if def_for_letter(c).is_some() {
|
||||
s.push(c);
|
||||
}
|
||||
}
|
||||
s
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Topic {
|
||||
|
|
@ -1131,7 +1157,7 @@ impl Server {
|
|||
&format!(":{} KICK {cname} {nick} :Flood", self.name),
|
||||
None,
|
||||
);
|
||||
self.propagate_from_user(uid, &format!("KICK {cname} {nick} :Flood"));
|
||||
self.propagate_kick(uid, &cname, &nick, "Flood");
|
||||
if let Some(c) = self.channels.get_mut(key) {
|
||||
c.members.remove(&uid);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue