[misc] XEP-0199 (Xmp ping) support.fixes #2947
This commit is contained in:
parent
27ffd437a9
commit
f450c0eb65
2 changed files with 9 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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' # "
|
||||
|
|
Loading…
Add table
Reference in a new issue