mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
bin/ircd: clip nicks with length more than MAXIMUM_LENGTH_OF_NICKNAME instead of skipping their msgs
This commit is contained in:
@@ -61,9 +61,10 @@ impl ProtocolPrivmsg {
|
||||
|
||||
loop {
|
||||
let msg = self.msg_sub.receive().await?;
|
||||
let mut msg = (*msg).to_owned();
|
||||
|
||||
if msg.nickname.len() > MAXIMUM_LENGTH_OF_NICKNAME {
|
||||
continue
|
||||
msg.nickname = msg.nickname[..MAXIMUM_LENGTH_OF_NICKNAME].to_string();
|
||||
}
|
||||
|
||||
if self.msg_ids.lock().await.contains(&msg.id) {
|
||||
@@ -71,14 +72,13 @@ impl ProtocolPrivmsg {
|
||||
}
|
||||
|
||||
self.msg_ids.lock().await.push(msg.id);
|
||||
let msg = (*msg).clone();
|
||||
|
||||
// add the msg to the buffer
|
||||
self.msgs.lock().await.push(msg.clone());
|
||||
|
||||
self.notify_queue_sender.send(msg.clone()).await?;
|
||||
|
||||
self.p2p.broadcast_with_exclude(msg.clone(), &exclude_list).await?;
|
||||
self.p2p.broadcast_with_exclude(msg, &exclude_list).await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user