From 668bbf43f1dfeec2f421c42a3b0232cbabda9dec Mon Sep 17 00:00:00 2001 From: Thierry Carrez Date: Mon, 3 Sep 2018 13:15:23 +0200 Subject: [PATCH] ptgbot should still ask for identify-map cap In the recent SSL/SASL introduction, we removed the on_welcome() and on_cap() functions which were thought to be taken care of by the introduced mixins. Turns out it was not the case and the bot needs the identify-msg cap in order to function, so we should restore that code. Change-Id: I11f94ddc2be7e3ff6592dd2c2e5fbfb43f6309f7 --- ptgbot/bot.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ptgbot/bot.py b/ptgbot/bot.py index 984cab7..58ec0d1 100644 --- a/ptgbot/bot.py +++ b/ptgbot/bot.py @@ -63,6 +63,18 @@ class PTGBot(SASL, SSL, irc.bot.SingleServerIRCBot): self.identify_msg_cap = False self.data = db + def on_welcome(self, c, e): + self.identify_msg_cap = False + self.log.debug("Requesting identify-msg capability") + c.cap('REQ', 'identify-msg') + c.cap('END') + + def on_cap(self, c, e): + self.log.debug("Received cap response %s" % repr(e.arguments)) + if e.arguments[0] == 'ACK' and 'identify-msg' in e.arguments[1]: + self.log.debug("identify-msg cap acked") + self.identify_msg_cap = True + def usage(self, channel): self.send(channel, "Format is '#TRACK COMMAND [PARAMETERS]'") self.send(channel, "See doc at: " + DOC_URL)