Просмотр исходного кода

bin/ircd: fix a terrible mistake causes the message to be the second element instead counting from it

Dastan-glitch 3 лет назад
Родитель
Сommit
b08a0f1928
1 измененных файлов с 2 добавлено и 3 удалено
  1. 2 3
      bin/ircd/src/irc/client.rs

+ 2 - 3
bin/ircd/src/irc/client.rs

@@ -450,7 +450,6 @@ impl<C: AsyncRead + AsyncWrite + Send + Unpin + 'static> IrcClient<C> {
     }
 
     async fn on_receive_privmsg(&mut self, line: &str, target: &str) -> Result<()> {
-        info!("line: {}", line);
         let message = match line.find(':') {
             Some(substr_idx) => {
                 if substr_idx >= line.len() {
@@ -459,8 +458,8 @@ impl<C: AsyncRead + AsyncWrite + Send + Unpin + 'static> IrcClient<C> {
                 line[substr_idx + 1..].to_string()
             }
             None => {
-                let split = line.split(' ').collect::<Vec<&str>>()[2];
-                split.to_string()
+                let split = line.split(' ').collect::<Vec<_>>()[2..].to_vec();
+                split.join(" ")
             }
         };