MGranatels / IRC

4 stars 1 forks source link

QUIT and PART messages #32

Open gabriela-freitas opened 1 year ago

gabriela-freitas commented 1 year ago

In Manager::removeClientFromAllChannels() this method should be updated to comply with the protocol, as well as Manager::rremoveClient()

Some messages from chatGPT to clarify the matter:

Yes, there is a protocol and a standard message that servers can send when a user leaves the server or all channels. The message is called "QUIT" and follows the IRC protocol.

The QUIT message is sent by the user's client when the user disconnects from the server. It is used to notify other users and channels that the user is leaving. The QUIT message has the following format:

QUIT :<Quit message>

The is an optional parameter that provides a reason or message indicating why the user is leaving the server. For example:

QUIT :Leaving the server

When a user sends a QUIT message, the IRC server broadcasts this message to all channels that the user is currently a member of. The other users in those channels will see the quit message, indicating that the user has left the server.

And when a user leaves a channel, you can send a message like this to the channel:

PART #channel_name Additionally, you can send messages to the user list in the channel to notify other users about the joining or leaving user:

:<user_nick>!<user_name>@<host_name> PART #channel_name

These messages are essential to keep the user lists updated in each channel, as there is no automatic mechanism for doing this in the IRC protocol. By properly managing and updating the user lists, you ensure that all users in the channel are aware of changes in the channel's membership.

dmbcalado commented 1 year ago

Image

Apos dar quit:

Image

E sai com sucesso de todos os channels. O quit esta praticamente feito, gostava de so deixar uma mensagem para os users que ficaram a dizer tipo " user X has quit the channel."