Ignore sts tokens on plain-text connections if no port key is provided

This commit is contained in:
jesopo 2019-06-10 14:01:58 +01:00
parent 53907b57d7
commit 807e239a2b

View file

@ -35,10 +35,11 @@ class Module(ModuleManager.BaseModule):
info = utils.parse.keyvalue(event["capabilities"][sts],
delimiter=",")
if not event["server"].connection_params.tls:
self.set_policy(event["server"], int(info["port"]), None)
event["server"].disconnect()
self.bot.reconnect(event["server"].id,
event["server"].connection_params)
if "port" in info:
self.set_policy(event["server"], int(info["port"]), None)
event["server"].disconnect()
self.bot.reconnect(event["server"].id,
event["server"].connection_params)
else:
self.change_duration(event["server"], info)