From 73df2217d90dd1ffd006238d7ad3b38575dd107b Mon Sep 17 00:00:00 2001 From: Xnoe Date: Sun, 20 Jun 2021 22:36:29 +0100 Subject: [PATCH] Updated Makefile. Removed commented out code. --- Makefile | 17 +++++++++-------- user.cpp | 6 +----- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 9b7f09d..52da20e 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,29 @@ FLAGS = -pthread +OFLAGS = -g xnoircd: user.o nameable.o channel.o connection.o ircserver.o irccommand.o userconnection.o main.o g++ $(FLAGS) user.o nameable.o channel.o connection.o ircserver.o irccommand.o userconnection.o main.o -o $@ user.o: user.cpp user.h - g++ -g -c $*.cpp + g++ $(OFLAGS) -c $*.cpp connection.o: connection.cpp connection.h - g++ -g -c $*.cpp + g++ $(OFLAGS) -c $*.cpp ircserver.o: ircserver.cpp ircserver.h - g++ -g -c $*.cpp + g++ $(OFLAGS) -c $*.cpp irccommand.o: irccommand.cpp irccommand.h - g++ -g -c $*.cpp + g++ $(OFLAGS) -c $*.cpp userconnection.o: userconnection.cpp userconnection.h - g++ -g -c $*.cpp + g++ $(OFLAGS) -c $*.cpp nameable.o: nameable.cpp nameable.h - g++ -g -c $*.cpp + g++ $(OFLAGS) -c $*.cpp channel.o: channel.cpp channel.h - g++ -g -c $*.cpp + g++ $(OFLAGS) -c $*.cpp main.o: main.cpp - g++ -g -c $*.cpp \ No newline at end of file + g++ $(OFLAGS) -c $*.cpp \ No newline at end of file diff --git a/user.cpp b/user.cpp index 73767bf..61f1ba5 100644 --- a/user.cpp +++ b/user.cpp @@ -125,10 +125,6 @@ std::vector User::privmsg_cmd(IRCCommand cmd) { if (server->has_addressable_name(named_target)) { Nameable* target = server->resolve_addressable_name(named_target); - /*for (Nameable* associate : target->get_associates()) { - if (associate->get_addressable_name() != this->get_nick()) - associate->send_direct({IRCCommand(this->get_nick(), "PRIVMSG", named_target, cmd.get_parameter(1))}); - }*/ target->send_direct({IRCCommand(this->get_nick(), "PRIVMSG", named_target, cmd.get_parameter(1))}, this->get_nick()); } @@ -203,7 +199,7 @@ std::vector User::motd_cmd(IRCCommand cmd) { std::vector User::process_cmd(IRCCommand cmd) { auto command = commands.find(cmd.get_command()); - //return {}; + if (command == commands.end()) { return {IRCCommand(server->get_hostname(), "421", get_nick(), cmd.get_command(), "Unknown Command.")}; }