diff --git a/sources/channel/channel.cpp b/sources/channel/channel.cpp index 8aa492c..ca94356 100644 --- a/sources/channel/channel.cpp +++ b/sources/channel/channel.cpp @@ -6,15 +6,18 @@ /* By: sben-tay +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/05/20 22:43:24 by rparodi #+# #+# */ -/* Updated: 2025/06/19 01:16:03 by sben-tay ### ########.fr */ +/* Updated: 2025/06/19 11:33:25 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #include "channel.hpp" #include -Channel::Channel(const std::string &name, User *owner, size_t maxUsers, bool needInvite) - :_name(name), _owner(owner), _maxUsers(maxUsers), _needInvite(needInvite) {} +Channel::Channel(const std::string &name, User *owner, size_t maxUsers, bool needInvite) : _name(name), _owner(owner), _maxUsers(maxUsers), _needInvite(needInvite) { + this->_protectTopic = false; + this->_maxUsers = ~0; + this->_topic = "No topic is set"; +} /** * @brief Get the name of the channel diff --git a/sources/commands/commands.cpp b/sources/commands/commands.cpp index a26543a..806e075 100644 --- a/sources/commands/commands.cpp +++ b/sources/commands/commands.cpp @@ -6,25 +6,26 @@ /* By: sben-tay +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/05/24 16:11:56 by rparodi #+# #+# */ -/* Updated: 2025/06/10 16:25:57 by rparodi ### ########.fr */ +/* Updated: 2025/06/19 11:25:46 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #include "commands.hpp" #include -#include "join.hpp" -#include "privmsg.hpp" -#include "nick.hpp" -#include "invite.hpp" -#include "list.hpp" #include "cap.hpp" -#include "modes.hpp" -#include "ping.hpp" -#include "notice.hpp" +#include "invite.hpp" +#include "join.hpp" #include "kick.hpp" -#include "userCmd.hpp" -#include "pass.hpp" +#include "list.hpp" +#include "modes.hpp" +#include "nick.hpp" +#include "notice.hpp" #include "part.hpp" +#include "pass.hpp" +#include "ping.hpp" +#include "privmsg.hpp" +#include "topic.hpp" +#include "userCmd.hpp" #include "whois.hpp" #include "whowas.hpp" #include @@ -139,6 +140,10 @@ void cmd::dispatch(::User *user, Channel *channel, Server *server, std::string & userCmd(user, channel, server, line).execute(); } break; + case 't': + if (command_name == "topic") { + Topic(user, channel, server, line).execute(); + } case 'w': if (command_name == "whois") { Whois(user, channel, server, line).execute();