Browse Source

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
changes/57/599357/1
Thierry Carrez 3 years ago
parent
commit
668bbf43f1
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      ptgbot/bot.py

+ 12
- 0
ptgbot/bot.py View File

@ -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)


Loading…
Cancel
Save