Files
tg4xmpp/xmpp_tg/monkey.py
annelin bca6860159 [SVN] initial commit after SVN rebirth;
[SVN] bump to version 2.0
[UPD] now transport working with telethon 0.15.5 and sleekxmpp 1.3.2
[FIX] fixed everlasting authorization requests. if you got deauth message — ignore it, FROM subscription is enough.
[ADD] implemented roster exchange via XEP-0144
[ADD] we will send authorization request when unknown contact sent us a message
[ADD] correct presence handling for transport and users
[ADD] fixed presence spam (by default, we updating presence once for 60 seconds -- look at `status_update_interval` in mtproto.py)
[ADD] we will automatically connect to all actual sessions after transport start
2018-06-19 05:09:38 +00:00

23 lines
699 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from sleekxmpp.plugins.xep_0054 import XEP_0054
from sleekxmpp import Iq
from sleekxmpp.exceptions import XMPPError
def patched_handle_get_vcard(self, iq):
if iq['type'] == 'result':
self.api['set_vcard'](jid=iq['from'], args=iq['vcard_temp'])
return
elif iq['type'] == 'get':
vcard = self.api['get_vcard'](iq['to'].bare)
if isinstance(vcard, Iq):
vcard.send()
else:
iq = iq.reply()
iq.append(vcard)
iq.send()
elif iq['type'] == 'set':
raise XMPPError('service-unavailable')
# Грязно патчим баг в библиотеке
XEP_0054._handle_get_vcard = patched_handle_get_vcard