mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-10 18:59:33 +00:00
Remove mark from peer_id
This commit is contained in:
@@ -165,17 +165,8 @@ class MemorySession(Session):
|
||||
|
||||
def get_entity_rows_by_id(self, id, exact=True):
|
||||
try:
|
||||
if exact:
|
||||
return next((id, hash) for found_id, hash, _, _, _
|
||||
in self._entities if found_id == id)
|
||||
else:
|
||||
ids = (
|
||||
utils.get_peer_id(_tl.PeerUser(id)),
|
||||
utils.get_peer_id(_tl.PeerChat(id)),
|
||||
utils.get_peer_id(_tl.PeerChannel(id))
|
||||
)
|
||||
return next((id, hash) for found_id, hash, _, _, _
|
||||
in self._entities if found_id in ids)
|
||||
return next((id, hash) for found_id, hash, _, _, _
|
||||
in self._entities if found_id == id)
|
||||
except StopIteration:
|
||||
pass
|
||||
|
||||
|
@@ -316,16 +316,8 @@ class SQLiteSession(MemorySession):
|
||||
'select id, hash from entities where name = ?', name)
|
||||
|
||||
def get_entity_rows_by_id(self, id, exact=True):
|
||||
if exact:
|
||||
return self._execute(
|
||||
'select id, hash from entities where id = ?', id)
|
||||
else:
|
||||
return self._execute(
|
||||
'select id, hash from entities where id in (?,?,?)',
|
||||
utils.get_peer_id(_tl.PeerUser(id)),
|
||||
utils.get_peer_id(_tl.PeerChat(id)),
|
||||
utils.get_peer_id(_tl.PeerChannel(id))
|
||||
)
|
||||
return self._execute(
|
||||
'select id, hash from entities where id = ?', id)
|
||||
|
||||
# File processing
|
||||
|
||||
|
Reference in New Issue
Block a user