irc: Add TOPIC command
patch cb76ecce75bd80a41fdab176f9dacf94801e5e23
Author: E. Bosch <presidev@AT@gmail.com>
Date: Fri Feb 19 01:05:45 CET 2021
* irc: Add TOPIC command
hunk ./irc.py 34
+IRC_TOPIC_RX = re.compile(PREFIX + r'TOPIC( +:| +|\n)(?P<channel>[^\n ]+|)')
hunk ./irc.py 105
+ (IRC_TOPIC_RX, self.handle_irc_topic, True, True),
hunk ./irc.py 190
+ async def handle_irc_topic(self, user, channel):
+ self.logger.debug('Handling TOPIC: %s', channel)
+
+ chan = channel.lower()
+ real_chan = self.get_realcaps_name(chan)
+ await self.irc_channel_topic(user, real_chan)
+
hunk ./irc.py 328
- async def irc_channel_topic(self, user, channel, entity_cache):
- topic = await self.tg.get_channel_topic(channel, entity_cache)
- timestamp = await self.tg.get_channel_creation(channel, entity_cache)
- founder = list(self.irc_channels_founder[channel.lower()])[0]
+ async def irc_channel_topic(self, user, channel, entity_cache=[None]):
+ chan = channel.lower()
+ topic = await self.tg.get_channel_topic(chan, entity_cache)
+ timestamp = await self.tg.get_channel_creation(chan, entity_cache)
+ founder = list(self.irc_channels_founder[chan])[0]