Saphirac / ft_irc

MIT License
1 stars 1 forks source link

Fix the MODE command for channels #36

Closed JonathanDUFOUR closed 3 months ago

JonathanDUFOUR commented 3 months ago

Related to #35. The problem was that the Channel::Modes::set method calls didn't provide the additional argument while it is assumed to be present for some specific modes. Typically, everywhere we did:

modes_to_be[Cleared].set(KeyProtected);

or

modes_to_be[Cleared].set(Limit);

Also, I have fixed the -k mode change to require an argument, which must match the current key of the channel if any is set. Finally, I made the -l mode change to require an argument too, which must match the current member limit of the channel if any is set.

JonathanDUFOUR commented 3 months ago

In the same time, I fixed the PRIVMSG and the NOTICE commands when they are used to send text to a channel that is not joined. And I fixed the ERR_CHANOPRIVSNEEDED replies.