Merge branch 'master' into develop
This commit is contained in:
commit
04dc68f5f6
@ -12,6 +12,7 @@ import threading
|
|||||||
|
|
||||||
from sleekxmpp import JID
|
from sleekxmpp import JID
|
||||||
from sleekxmpp.stanza import Presence
|
from sleekxmpp.stanza import Presence
|
||||||
|
from sleekxmpp.exceptions import XMPPError
|
||||||
from sleekxmpp.xmlstream import register_stanza_plugin
|
from sleekxmpp.xmlstream import register_stanza_plugin
|
||||||
from sleekxmpp.xmlstream.matcher import StanzaPath
|
from sleekxmpp.xmlstream.matcher import StanzaPath
|
||||||
from sleekxmpp.xmlstream.handler import Callback
|
from sleekxmpp.xmlstream.handler import Callback
|
||||||
@ -103,6 +104,7 @@ class XEP_0153(BasePlugin):
|
|||||||
if own_jid:
|
if own_jid:
|
||||||
self.xmpp.roster[jid].send_last_presence()
|
self.xmpp.roster[jid].send_last_presence()
|
||||||
|
|
||||||
|
try:
|
||||||
iq = self.xmpp['xep_0054'].get_vcard(jid=jid.bare, ifrom=ifrom)
|
iq = self.xmpp['xep_0054'].get_vcard(jid=jid.bare, ifrom=ifrom)
|
||||||
|
|
||||||
data = iq['vcard_temp']['PHOTO']['BINVAL']
|
data = iq['vcard_temp']['PHOTO']['BINVAL']
|
||||||
@ -112,6 +114,8 @@ class XEP_0153(BasePlugin):
|
|||||||
new_hash = hashlib.sha1(data).hexdigest()
|
new_hash = hashlib.sha1(data).hexdigest()
|
||||||
|
|
||||||
self.api['set_hash'](jid, args=new_hash)
|
self.api['set_hash'](jid, args=new_hash)
|
||||||
|
except XMPPError:
|
||||||
|
log.debug('Could not retrieve vCard for %s' % jid)
|
||||||
|
|
||||||
def _recv_presence(self, pres):
|
def _recv_presence(self, pres):
|
||||||
if not pres.match('presence/vcard_temp_update'):
|
if not pres.match('presence/vcard_temp_update'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user