gros con
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/01/21 10:34:25 by maldavid #+# #+# */
|
||||
/* Updated: 2024/01/29 18:31:14 by vvaas ### ########.fr */
|
||||
/* Updated: 2024/01/29 20:04:19 by vvaas ### ########.fr */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace irc
|
||||
inline bool isInviteOnly() const { return _invite_only; }
|
||||
|
||||
void setTopic(unstd::SharedPtr<Client> client, const std::string& new_topic);
|
||||
void relayTopic(unstd::SharedPtr<Client> client);
|
||||
void relayTopic(unstd::SharedPtr<Client> client, bool broadcast = false);
|
||||
void showModesModify(unstd::SharedPtr<Client> client, const Message& msg) const;
|
||||
void showModes(unstd::SharedPtr<Client> client);
|
||||
bool kick(unstd::SharedPtr<Client> op, unstd::SharedPtr<Client> target, const std::string& reason);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/01/21 10:36:21 by maldavid #+# #+# */
|
||||
/* Updated: 2024/01/29 19:57:34 by vvaas ### ########.fr */
|
||||
/* Updated: 2024/01/29 20:10:28 by vvaas ### ########.fr */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
@@ -189,16 +189,24 @@ namespace irc
|
||||
return;
|
||||
}
|
||||
_topic = new_topic;
|
||||
relayTopic(client);
|
||||
relayTopic(client, true);
|
||||
}
|
||||
|
||||
void Channel::relayTopic(unstd::SharedPtr<Client> client)
|
||||
void Channel::relayTopic(unstd::SharedPtr<Client> client, bool broadcast)
|
||||
{
|
||||
if(!hasClient(client))
|
||||
return;
|
||||
if(_topic.empty())
|
||||
return client->sendCode(":yipirc" RPL_NOTOPIC, client->getNickName() + " " + _name, "no topic is set");
|
||||
return client->sendCode(":yipirc " RPL_TOPIC, client->getNickName() + " " + _name, _topic);
|
||||
{
|
||||
if (!broadcast)
|
||||
return (client->sendCode(":yipirc " RPL_NOTOPIC, client->getNickName() + " " + _name, "no topic is set"));
|
||||
for (client_it it = _clients.begin(); it != _clients.end(); ++ it)
|
||||
const_cast<unstd::SharedPtr<irc::Client>&>(*it)->sendCode(":yipirc " RPL_NOTOPIC, client->getNickName() + " " + _name, "no topic is set");
|
||||
}
|
||||
if (!broadcast)
|
||||
return (client->sendCode(":yipirc " RPL_TOPIC, client->getNickName() + " " + _name, _topic));
|
||||
for (client_it it = _clients.begin(); it != _clients.end(); ++ it)
|
||||
const_cast<unstd::SharedPtr<irc::Client>&>(*it)->sendCode(":yipirc " RPL_TOPIC, client->getNickName() + " " + _name, _topic);
|
||||
}
|
||||
|
||||
bool Channel::isOp(unstd::SharedPtr<Client> client) const
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/01/22 17:31:06 by maldavid #+# #+# */
|
||||
/* Updated: 2024/01/29 17:12:21 by vvaas ### ########.fr */
|
||||
/* Updated: 2024/01/29 20:01:48 by vvaas ### ########.fr */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user