mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-10 07:08:05 -05:00
show nick changes
This commit is contained in:
@@ -67,7 +67,10 @@ impl IrcServerConnection {
|
||||
"NICK" => {
|
||||
let nickname = tokens.next().ok_or(Error::MalformedPacket)?;
|
||||
self.is_nick_init = true;
|
||||
self.nickname = nickname.to_string();
|
||||
let old_nick = std::mem::replace(&mut self.nickname, nickname.to_string());
|
||||
|
||||
let nick_reply = format!(":{}!darkfi@127.0.0.1 NICK {}\n", old_nick, self.nickname);
|
||||
self.reply(&nick_reply).await?;
|
||||
}
|
||||
"USER" => {
|
||||
// We can stuff any extra things like public keys in here
|
||||
@@ -108,6 +111,10 @@ impl IrcServerConnection {
|
||||
};
|
||||
p2p.broadcast(protocol_msg).await?;
|
||||
}
|
||||
"QUIT" => {
|
||||
// Close the connection
|
||||
return Err(Error::ServiceStopped)
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user