ClientsDb = dict[str, 'Client']
_NAMES_DESIRED_SERVER_CAPS = ('server-time', 'account-tag', 'sasl')
+_NUMERIC_RANGES_TO_IGNORE = ((2, 4), # irrelevant login info
+ (251, 255), # more of the same, LUSERS-specific
+ (265, 266)) # more LUSERS stuff
class LogScope(Enum):
def handle_msg(self, msg: IrcMessage) -> None:
'Log msg.raw, then process incoming msg into appropriate client steps.'
self._log(msg.raw, scope=LogScope.RAW, out=False)
+ numerics_to_ignore = []
+ for min_, max_ in _NUMERIC_RANGES_TO_IGNORE:
+ numerics_to_ignore += list(range(min_, max_ + 1))
+ if msg.verb.isdigit() and int(msg.verb) in numerics_to_ignore:
+ return
match msg.verb:
case '001' | 'NICK':
self._update_db('nickname', value=msg.params[0], confirm=True)
- case '002' | '003' | '004':
- pass # explicitly ignored verbs/numerics
case '375':
self._db.set('motd', [], False)
case '372':