edmund-huber / ergonomadic

DISCONTINUED, see orogono
MIT License
132 stars 10 forks source link

MODE: Parse newer syntax, handle parameters correctly, don't send unnecessary NOTICE #30

Closed DanielOaks closed 6 years ago

DanielOaks commented 8 years ago

This fixes a few strange behaviours about the MODE command.

This PR extends the MODE command to parse the newer syntax that allows modestrings to both remove and add modes in the same string. For instance:

It also handles unused parameters correctly. Before, if it encountered a parameter that was unused, it would loop through those parameters as though they were modestrings as well, which is incorrect. Now it only parses the correct parameter as a modestring and ignores the unused params.

Upon discovering the modes of a channel/user (or changing user modes), Ergo would respond with a NOTICE like this: -- oragono.test: user dan has global:io #testchan:Oo #services: #a:Oo #test:Oo

This is already covered by the RPL_CHANNELMODEIS and RPL_UMODEIS numerics and the standard MODE messages already sent. A notice like that may be useful for debugging purposes but isn't required for standard operation and just clutters things.

prologic commented 7 years ago

Can you split this into three separate PRs? These seem like logical self-contained diffs.