faboussard / 42-irc

3 stars 1 forks source link

Kick #40

Closed faboussard closed 1 week ago

faboussard commented 1 week ago
  1. kick command ready - explanation of command in file of same name i call on part function (quit channel) because i find it funny but it can be removed
    kick #k nick bla
    :nick KICK #k :bla
    :nick PART #k : say goodbye!

Tests conducted :

join #s
:admin JOIN :#s
:ircserv.localhost 331 admin #s :No topic is set
:ircserv.localhost 353 admin #s :@admin 
:ircserv.localhost 366 admin #s :End of \NAMES list

kick #s
:ircserv.localhost 461 admin KICK :Not enough parameters

kick
:ircserv.localhost 461 admin KICK :Not enough parameters

kick #s adm
:ircserv.localhost 401 admin adm :No such nick/channel

kick #s nick
:ircserv.localhost 441 admin nick #s :They aren't on that channel

:nick JOIN #s : say hello!
kick #s nick :jojo
:nick KICK #s :jojo
:nick PART #s : say goodbye!

:nick JOIN #s : say hello!
kick #s nick jojo
:nick KICK #s :jojo
:nick PART #s : say goodbye!
  1. use of general function made by yuko broadcastInChannel for join and part.:

now i am using the function broadcastInChannel for join and part :
broadcastInChannel(client, channel, "PART", " say goodbye!");

Function called before or after the client's join/leave to avoid them receiving their own message.

  1. Server.hpp - function added:

Client *findClientByNickname(const std::string &nickname);

  1. some functions were put in comments if not used: cleaning to be done at the end of the project ( with clion that highlights the unused functions)

  2. valgrind OK