From 2864c41d7a7010a1deaaac9bb1ee4cbc69dcb702 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 14 May 2016 14:06:14 -0700 Subject: [PATCH] hybrid: only call endburst once per connection Since this is based off TS6, both initial PING and EOB are handled as endburst. However, ENDBURST should only be called once per session, or things are respawned automatically and nick collisions happen. --- protocols/hybrid.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/protocols/hybrid.py b/protocols/hybrid.py index 082a32c..d30e49b 100644 --- a/protocols/hybrid.py +++ b/protocols/hybrid.py @@ -19,11 +19,12 @@ class HybridProtocol(TS6Protocol): self.casemapping = 'ascii' self.caps = {} self.hook_map = {'EOB': 'ENDBURST', 'TBURST': 'TOPIC', 'SJOIN': 'JOIN'} + self.has_eob = False def connect(self): """Initializes a connection to a server.""" ts = self.irc.start_ts - + self.has_eob = False f = self.irc.send # https://github.com/grawity/irc-docs/blob/master/server/ts6.txt#L80 @@ -210,7 +211,10 @@ class HybridProtocol(TS6Protocol): def handle_eob(self, numeric, command, args): log.debug('(%s) end of burst received', self.irc.name) - return {} + if not self.has_eob: # Only call ENDBURST hooks if we haven't already. + return {} + + self.has_eob = True def handle_svsmode(self, numeric, command, args): """