patch 8a4fa2a2053e3c2bceac8f793f0f3c77e3213fd8 Author: E. Bosch Date: Sun Feb 14 01:55:27 CET 2021 * irc: Add NAMES command diff -rN -u old-irgramd/irc.py new-irgramd/irc.py --- old-irgramd/irc.py 2024-11-23 02:42:17.329643642 +0100 +++ new-irgramd/irc.py 2024-11-23 02:42:17.329643642 +0100 @@ -25,6 +25,7 @@ PREFIX = r'(:[^ ]+ +|)' IRC_JOIN_RX = re.compile(PREFIX + r'JOIN( +|\n)(?P[^ ]+)') +IRC_NAMES_RX = re.compile(PREFIX + r'NAMES( +|\n)(?P[^ ]+)') IRC_NICK_RX = re.compile(PREFIX + r'NICK( +:| +|\n)(?P[^\n]+|)') IRC_PASS_RX = re.compile(PREFIX + r'PASS( +:| +|\n)(?P[^\n]+|)') IRC_PING_RX = re.compile(PREFIX + r'PING( +:| +|\n)(?P[^\n]+|)') @@ -93,6 +94,7 @@ self.irc_handlers = ( # pattern handle register_required (IRC_JOIN_RX, self.handle_irc_join, True), + (IRC_NAMES_RX, self.handle_irc_names, True), (IRC_NICK_RX, self.handle_irc_nick, False), (IRC_PASS_RX, self.handle_irc_pass, False), (IRC_PING_RX, self.handle_irc_ping, True), @@ -167,6 +169,12 @@ else: await self.reply_code(user, 'ERR_NOSUCHCHANNEL', (channel,)) + async def handle_irc_names(self, user, channels): + self.logger.debug('Handling NAMES: %s', channels) + + for channel in channels.split(','): + await self.irc_namelist(user, channel) + async def handle_irc_ping(self, user, payload): self.logger.debug('Handling PING: %s', payload)