From cdd139eefb7bc3cce65d21b0e1e6ef80fc742435 Mon Sep 17 00:00:00 2001 From: ghassmo Date: Wed, 29 Jun 2022 15:21:59 +0300 Subject: [PATCH] bin/ircd: fix a bug in DM --- bin/ircd/script/run_node.sh | 9 --------- bin/ircd/script/run_seed_node.sh | 4 ---- bin/ircd/src/server.rs | 7 ++++++- 3 files changed, 6 insertions(+), 14 deletions(-) delete mode 100755 bin/ircd/script/run_node.sh delete mode 100755 bin/ircd/script/run_seed_node.sh diff --git a/bin/ircd/script/run_node.sh b/bin/ircd/script/run_node.sh deleted file mode 100755 index 2c994367d..000000000 --- a/bin/ircd/script/run_node.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# Change this value to the hostname of the seed server -SEED_HOSTNAME=XXX - -LOCAL_IP=$(ip route get 8.8.8.8 | head -1 | awk '{print $7}') -SEED_IP=$(getent hosts $SEED_HOSTNAME.local | awk '{print $1}' | head -n 1) -cargo run -- --accept 0.0.0.0:11004 --slots 5 --external $LOCAL_IP:11004 --seeds $SEED_IP:9999 --irc 127.0.0.1:6667 - diff --git a/bin/ircd/script/run_seed_node.sh b/bin/ircd/script/run_seed_node.sh deleted file mode 100755 index c782a5bf1..000000000 --- a/bin/ircd/script/run_seed_node.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -LOCAL_IP=$(ip route get 8.8.8.8 | head -1 | awk '{print $7}') -cargo run -- --accept 0.0.0.0:9999 --irc 127.0.0.1:6688 - diff --git a/bin/ircd/src/server.rs b/bin/ircd/src/server.rs index 77744361f..f7ff82cba 100644 --- a/bin/ircd/src/server.rs +++ b/bin/ircd/src/server.rs @@ -354,9 +354,14 @@ impl IrcServerConnection { if !chan_info.names.contains(&msg.nickname) { chan_info.names.push(msg.nickname.clone()); } + + self.reply(&msg.to_irc_msg()).await?; + } + + if self.is_nick_init && self.nickname == msg.target { + self.reply(&msg.to_irc_msg()).await?; } - self.reply(&msg.to_irc_msg()).await?; Ok(()) }