From f9f3e97f426927b1b8fc146fa182fab68f537330 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 15 Apr 2016 12:30:31 -0700 Subject: [PATCH] nefarious: handle end of burst (send acknowledgement and hook) --- protocols/nefarious.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/protocols/nefarious.py b/protocols/nefarious.py index e233ec0..07faf06 100644 --- a/protocols/nefarious.py +++ b/protocols/nefarious.py @@ -83,6 +83,8 @@ class P10Protocol(Protocol): # SID generator for P10. self.sidgen = P10SIDGenerator(irc) + self.hook_map = {'END_OF_BURST': 'ENDBURST'} + def _send(self, source, text): self.irc.send("%s %s" % (source, text)) @@ -566,4 +568,11 @@ class P10Protocol(Protocol): handle_create = handle_join + def handle_end_of_burst(self, source, command, args): + """Handles end of burst from our uplink.""" + # Send EOB acknowledgement; this is required by the P10 specification, + # and needed if we want to be able to receive channel messages, etc. + self._send(self.irc.sid, 'EA') + return {} + Class = P10Protocol