feat(cmd/pass): adding the start of pass command
This commit is contained in:
parent
3d71d977d2
commit
8565a948ce
9 changed files with 42 additions and 16 deletions
|
|
@ -6,12 +6,13 @@
|
|||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/24 16:11:56 by rparodi #+# #+# */
|
||||
/* Updated: 2025/05/26 18:25:18 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/05/29 12:48:13 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "commands.hpp"
|
||||
#include "logs.hpp"
|
||||
#include "pass.hpp"
|
||||
|
||||
/**
|
||||
* @brief To send the line where a command is invoqued to execute
|
||||
|
|
@ -91,6 +92,9 @@ void cmd::dispatch(::User *user, Channel *channel, Server *server, const std::st
|
|||
// }
|
||||
break;
|
||||
case 'p':
|
||||
if (command_name == "pass") {
|
||||
Pass(user, channel, server, line).execute();
|
||||
}
|
||||
// if (command_name == "part") {
|
||||
// Part(user, channel, server, line).execute();
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/05/24 17:29:48 by rparodi #+# #+# */
|
||||
/* Updated: 2025/05/26 22:50:04 by rparodi ### ########.fr */
|
||||
/* Updated: 2025/05/29 12:10:25 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -25,7 +25,8 @@ bool Invite::checkArgs() {
|
|||
WARNING_MSG("Invalid channel name for INVITE command");
|
||||
INFO_MSG("Channel names must start with a '#' character");
|
||||
return false;
|
||||
}
|
||||
} else
|
||||
_args.at(1).erase(0, 1);
|
||||
_cTarget = searchList(_channels, _args.at(1));
|
||||
if (_cTarget == NULL) {
|
||||
WARNING_MSG("Channel not found for INVITE command");
|
||||
|
|
@ -55,6 +56,10 @@ bool Invite::checkArgs() {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Execute the invite command
|
||||
* @note To invite a peapol to join a channel (from an operator)
|
||||
*/
|
||||
void Invite::execute() {
|
||||
if (checkArgs() == false) {
|
||||
ERROR_MSG("Invalid arguments for INVITE command (see warning message)");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue