[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
This commit is contained in:
22
xmpp_tg/monkey.py
Normal file
22
xmpp_tg/monkey.py
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
Reference in New Issue
Block a user