modules: draft/event-playback — record JOIN/PART/QUIT/NICK/MODE/TOPIC/KICK into CHATHISTORY, replayed only for cap clients (event_playback config, default on)
This commit is contained in:
parent
9dcc269f45
commit
6bb8ccd8ee
8 changed files with 179 additions and 19 deletions
|
|
@ -622,7 +622,9 @@ impl Command for Kick {
|
|||
.get(&vuuid)
|
||||
.map(|r| r.nick.clone())
|
||||
.unwrap_or_else(|| victim.to_string());
|
||||
s.to_channel(&key, &format!(":{prefix} KICK {chan} {vnick} :{reason}"), None);
|
||||
let kline = format!(":{prefix} KICK {chan} {vnick} :{reason}");
|
||||
crate::modules::chathistory::record_event(s, &key, &kline);
|
||||
s.to_channel(&key, &kline, None);
|
||||
s.propagate_kick(uid, chan, victim, &reason);
|
||||
if let Some(ch) = s.channels.get_mut(&key) {
|
||||
ch.rmembers.remove(&vuuid);
|
||||
|
|
@ -760,7 +762,9 @@ impl Command for TopicCmd {
|
|||
ts: now(),
|
||||
});
|
||||
}
|
||||
s.to_channel(&key, &format!(":{prefix} TOPIC {target} :{text}"), None);
|
||||
let tline = format!(":{prefix} TOPIC {target} :{text}");
|
||||
crate::modules::chathistory::record_event(s, &key, &tline);
|
||||
s.to_channel(&key, &tline, None);
|
||||
s.propagate_topic(uid, target, &text); // tell links
|
||||
CmdResult::Ok
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,11 +175,9 @@ pub fn apply_mode(s: &mut Server, uid: Uid, params: &[String]) -> CmdResult {
|
|||
{
|
||||
crate::modules::hidemode::broadcast(s, &key, target, uid, &prefix, &changes);
|
||||
} else {
|
||||
s.to_channel(
|
||||
&key,
|
||||
&format!(":{prefix} MODE {target} {applied}{pstr}"),
|
||||
None,
|
||||
);
|
||||
let mline = format!(":{prefix} MODE {target} {applied}{pstr}");
|
||||
crate::modules::chathistory::record_event(s, &key, &mline);
|
||||
s.to_channel(&key, &mline, None);
|
||||
}
|
||||
// links: a timestamped FMODE sourced from the acting user's uuid
|
||||
let src_uuid = s.users[&uid].uuid.clone();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue