[SVN] release 0.4.0
[SVN] all comments in code now in English; Sofia ♥ Fuck you with this barbarian language in code comments! (no, no fuck please) [FIX] monkey-patched telethon library to fix updates receiving in some sessions (fix github issue #686; commit b20aa0ccc91b3d767c26702f3611c44772d87f5a) [FIX] fixed "normal" quotation, such as `> text`, in previous releases it was intended to be message id to reply [FIX] now processing bots in contact list, in roster with `b` prefix [FIX] fixed message editing and deleting in supergroups [FIX] now removing old telegram session from database when initiating a new one for current JID [FIX] fixed group creating; group, supergroup, channels creating is now OK and tested [FIX] fixed processing bot in roster; now it does not crashes gateway [UPD] default status update interval is now 30 [UPD] slighly (and finally) changed behaviour of presences: `Last seen recently` = `dnd (do not disturb)`, because user that enabled this privacy settings does not want you to disturb `Last seen a long time ago` = `xa (extended away)`, because it is 'long' away 'Last seen at %date%` = `away`, because user just got away [ADD] basic interaction with bots (now only with text commands)
This commit is contained in:
@@ -2,6 +2,7 @@ from sleekxmpp.plugins.xep_0054 import XEP_0054
|
||||
from sleekxmpp import Iq
|
||||
from sleekxmpp.exceptions import XMPPError
|
||||
|
||||
from telethon.update_state import UpdateState
|
||||
|
||||
def patched_handle_get_vcard(self, iq):
|
||||
if iq['type'] == 'result':
|
||||
@@ -18,5 +19,25 @@ def patched_handle_get_vcard(self, iq):
|
||||
elif iq['type'] == 'set':
|
||||
raise XMPPError('service-unavailable')
|
||||
|
||||
# Грязно патчим баг в библиотеке
|
||||
def patched_stop_workers(self):
|
||||
"""
|
||||
Waits for all the worker threads to stop.
|
||||
"""
|
||||
# Put dummy ``None`` objects so that they don't need to timeout.
|
||||
n = self._workers
|
||||
self._workers = None
|
||||
if n:
|
||||
with self._updates_lock:
|
||||
for _ in range(n):
|
||||
self._updates.put(None)
|
||||
|
||||
for t in self._worker_threads:
|
||||
t.join()
|
||||
|
||||
self._worker_threads.clear()
|
||||
self._workers = n
|
||||
|
||||
|
||||
# hey i'm baboon
|
||||
XEP_0054._handle_get_vcard = patched_handle_get_vcard
|
||||
UpdateState.stop_workers = patched_stop_workers
|
||||
|
||||
Reference in New Issue
Block a user