MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _apply_message

Method _apply_message

irc_dpi.py:365–382  ·  view source on GitHub ↗
(sess: IRCSession, msg: IRCMessage)

Source from the content-addressed store, hash-verified

363
364 @staticmethod
365 def _apply_message(sess: IRCSession, msg: IRCMessage) -> None:
366 cmd = msg.command
367 params = msg.params
368 if cmd == 'NICK' and params and msg.direction == 'c2s':
369 sess.nick = params[0]
370 elif cmd == 'USER' and params and msg.direction == 'c2s':
371 sess.user = params[0]
372 elif cmd == 'JOIN' and params:
373 for ch in params[0].split(','):
374 ch = ch.strip()
375 if ch:
376 sess.channels.add(ch)
377 elif cmd == 'PART' and params:
378 for ch in params[0].split(','):
379 sess.channels.discard(ch.strip())
380 elif cmd in _BANNER_NUMERICS and params:
381 # Last param is the human-readable banner text
382 sess.server_banner.append(params[-1][:200])
383
384 # ------------------------------------------------------------------ #
385 # Accessors

Callers 1

_update_sessionMethod · 0.95

Calls 2

addMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected