diff --git a/sleekxmpp/plugins/xep_0199.py b/sleekxmpp/plugins/xep_0199.py index ccd284f..a78fd5f 100644 --- a/sleekxmpp/plugins/xep_0199.py +++ b/sleekxmpp/plugins/xep_0199.py @@ -18,8 +18,8 @@ class xep_0199(base.base_plugin): self.xep = "0199" self.xmpp.add_handler("" % self.xmpp.default_ns, self.handler_ping, name='XMPP Ping') self.running = False - #if self.config.get('keepalive', True): - #self.xmpp.add_event_handler('session_start', self.handler_pingserver, threaded=True) + if self.config.get('keepalive', True): + self.xmpp.add_event_handler('session_start', self.handler_pingserver, threaded=True) def post_init(self): base.base_plugin.post_init(self) @@ -35,7 +35,7 @@ class xep_0199(base.base_plugin): def handler_ping(self, xml): iq = self.xmpp.makeIqResult(xml.get('id', 'unknown')) - iq.attrib['to'] = xml.get('from', self.xmpp.server) + iq.attrib['to'] = xml.get('from', self.xmpp.boundjid.domain) self.xmpp.send(iq) def sendPing(self, jid, timeout = 30):