patch 6acc2599b3961c177cac87db79969190e17ec6ee
Author: E. Bosch <presidev@AT@gmail.com>
Date: Sat Feb 12 01:29:36 CET 2022
* irc: Improve MODE command hanlder
Add support for empty banlist response
hunk ./irc.py 261
+ is_user = False
+ is_channel = False
+
+ tgt = target.lower()
+ if tgt in self.users.keys():
+ if tgt == user.irc_nick:
+ is_user = True
+ else:
+ await self.reply_code(user, 'ERR_USERSDONTMATCH')
+ elif tgt[0] == '#':
+ if tgt in self.irc_channels.keys():
+ is_channel = True
+ else:
+ await self.reply_code(user, 'ERR_NOSUCHCHANNEL', (target,))
+ else:
+ await self.reply_code(user, 'ERR_NOSUCHNICK', (target,))
+
hunk ./irc.py 279
- tgt = target.lower()
- if tgt in self.users.keys():
- if tgt == user.irc_nick:
- await self.mode_user(user, user, False)
- else:
- await self.reply_code(user, 'ERR_USERSDONTMATCH')
- elif tgt[0] == '#':
- if tgt in self.irc_channels.keys():
- await self.mode_channel(user, target, False)
- else:
- await self.reply_code(user, 'ERR_NOSUCHCHANNEL', (target,))
- else:
- await self.reply_code(user, 'ERR_NOSUCHNICK', (target,))
+ if is_user:
+ await self.mode_user(user, user, False)
+ if is_channel:
+ await self.mode_channel(user, target, False)
+ elif mode == 'b' and is_channel:
+ await self.reply_code(user, 'RPL_ENDOFBANLIST', (target,))
hunk ./irc_replies.py 31
+ 'RPL_ENDOFBANLIST': ('368', '{} :End of channel ban list'),