From 34a6cb20975495275bea484a046526ff99b9f001 Mon Sep 17 00:00:00 2001 From: jdomingu98 Date: Wed, 24 Apr 2024 23:41:21 +0200 Subject: [PATCH] fix(join command): Send rpl topic on user joining when is set --- src/commands/JoinCommand.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/commands/JoinCommand.cpp b/src/commands/JoinCommand.cpp index ddb38b6..5b387c3 100644 --- a/src/commands/JoinCommand.cpp +++ b/src/commands/JoinCommand.cpp @@ -89,6 +89,8 @@ void JoinCommand::sendMessages(int clientFd, Channel &channel) const { server.sendMessage(channelUsers[i].getFd(), JOIN_MSG(nickname, username, hostname, channelName)); } + if (!channel.getTopic().empty()) + server.sendMessage(clientFd, RPL_TOPIC(nickname, username, hostname, channelName, channel.getTopic())); server.sendMessage(clientFd, rplNamReply(nickname, username, hostname, channel)); server.sendMessage(clientFd, RPL_END_OF_NAMES(nickname, username, hostname, channelName)); }