diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index 0bd42aa16180327c71983abffcc1eb0b31492d2c..5f145ec5c64120871d99473ae20b53e0a12fb057 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -1850,6 +1850,12 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, errcode = iq_obj.getErrorCode() self.dispatch('MSGERROR', (jid, errcode, errmsg)) + def _IqPingCB(self, con, iq_obj): + gajim.log.debug('IqPingCB') + iq_obj = iq_obj.buildReply('result') + self.connection.send(iq_obj) + raise common.xmpp.NodeProcessed + def _getRosterCB(self, con, iq_obj): if not self.connection: return @@ -2014,6 +2020,8 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, common.xmpp.NS_DISCO_INFO) con.RegisterHandler('iq', self._DiscoverItemsGetCB, 'get', common.xmpp.NS_DISCO_ITEMS) + con.RegisterHandler('iq', self._IqPingCB, 'get', + common.xmpp.NS_PING) con.RegisterHandler('iq', self._PubSubCB, 'result') con.RegisterHandler('iq', self._ErrorCB, 'error') con.RegisterHandler('iq', self._IqCB) diff --git a/src/common/xmpp/protocol.py b/src/common/xmpp/protocol.py index 1ee8ea96c47578fa5979cdb3c938efeaa0ffb1b1..6267e201aabc318d84b5ae4d693a5c0089ee437e 100644 --- a/src/common/xmpp/protocol.py +++ b/src/common/xmpp/protocol.py @@ -93,6 +93,7 @@ NS_GMAILNOTIFY ='google:mail:notify' NS_GTALKSETTING ='google:setting' NS_VCARD_UPDATE =NS_VCARD+':x:update' NS_VERSION ='jabber:iq:version' +NS_PING ='urn:xmpp:ping' # XEP-0199 NS_WAITINGLIST ='http://jabber.org/protocol/waitinglist' # JEP-0130 NS_XHTML_IM ='http://jabber.org/protocol/xhtml-im' # JEP-0071 NS_XHTML = 'http://www.w3.org/1999/xhtml' # "