irc: Move valid_nick() to IRCUser class
patch 7ae0aa39e474aa8974b0da88ffe14125da15ec66
Author: E. Bosch <presidev@AT@gmail.com>
Date: Thu Jan 28 14:07:44 CET 2021
* irc: Move valid_nick() to IRCUser class
hunk ./irc.py 115
- if not self.valid_nick(nick):
+ if not user.valid_nick(nick):
hunk ./irc.py 237
- def valid_nick(self, nick):
- if len(nick) <= NICK_MAX_LENGTH and nick[0] in VALID_IRC_NICK_FIRST_CHARS:
- for x in nick[1:]:
- if x not in VALID_IRC_NICK_CHARS:
- return 0
- return 1
- else: return 0
-
hunk ./irc.py 247
+
+ def valid_nick(self, nick):
+ if len(nick) <= NICK_MAX_LENGTH and nick[0] in VALID_IRC_NICK_FIRST_CHARS:
+ for x in nick[1:]:
+ if x not in VALID_IRC_NICK_CHARS:
+ return 0
+ return 1
+ else: return 0