From edbf43f81f8786607b77ef896ce4ce8e4b550358 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 29 Oct 2011 17:22:27 -0400 Subject: [PATCH] irclib: Add support for 004 messages from the server At a minimum, the message gives us the server name, ircd version, supported umodes, and supported channel modes. Add the umodes and channel modes to self.supported. Some IRCds (e.g., hybrid and ircd-seven) have an extra arg which seems to be the channel modes that require arguments. Signed-off-by: James McCoy (cherry picked from commit c9e548bdd926f1f4542a5b0121a0b9251706d36b) Signed-off-by: Daniel Folkinshteyn --- src/irclib.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/irclib.py b/src/irclib.py index 0efa1abc8..10112e573 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -401,6 +401,15 @@ class IrcState(IrcCommandDispatcher): """Returns the hostmask for a given nick.""" return self.nicksToHostmasks[nick] + def do004(self, irc, msg): + """Handles parsing the 004 reply + + Supported user and channel modes are cached""" + # msg.args = [nick, server, ircd-version, umodes, modes, + # modes that require arguments? (non-standard)] + self.supported['umodes'] = msg.args[3] + self.supported['chanmodes'] = msg.args[4] + _005converters = utils.InsensitivePreservingDict({ 'modes': int, 'keylen': int,