Commits

Stephen McDonald  committed 4d4f327 Draft

Initial forward compatibility with latest version of irclib.

  • Participants
  • Parent commits 6ce31ab

Comments (0)

Files changed (1)

File gnotty/client.py

             return False
 
     def _dispatcher(self, connection, event):
+        if not callable(event.arguments):
+            # irclib decided to change the event API, so here
+            # we make it backward compatible.
+            arguments = event.arguments
+            event.arguments = lambda: arguments
+            event.eventtype = lambda: event.type
+            source = event.source
+            event.source = lambda: source
         event_args = "".join(event.arguments()).decode("utf-8")
         log = (event.eventtype(), self.nickname, event_args)
         getLogger("irc.dispatch").debug("%s: [%s] %s" % log)