Only "finish" a sasl handshake when we get a 900

This commit is contained in:
jesopo 2018-09-07 16:04:37 +01:00
parent 7e3d7542b9
commit 66e10ba11d

View file

@ -7,6 +7,7 @@ class Module(object):
events.on("received.cap.ls").hook(self.on_cap)
events.on("received.cap.ack").hook(self.on_cap_ack)
events.on("received.authenticate").hook(self.on_authenticate)
events.on("received.numeric.900").hook(self.sasl_success)
def preprocess_connect(self, event):
sasl = event["server"].get_setting("sasl")
@ -39,4 +40,6 @@ class Module(object):
auth_text = base64.b64encode(auth_text.encode("utf8"))
auth_text = auth_text.decode("utf8")
event["server"].send_authenticate(auth_text)
def sasl_success(self, event):
event["server"].capability_done("sasl")