py-tgcalls 2.2.0rc2__py3-none-any.whl → 2.2.0rc3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {py_tgcalls-2.2.0rc2.dist-info → py_tgcalls-2.2.0rc3.dist-info}/METADATA +2 -2
- {py_tgcalls-2.2.0rc2.dist-info → py_tgcalls-2.2.0rc3.dist-info}/RECORD +16 -16
- pytgcalls/__version__.py +1 -1
- pytgcalls/filters.py +6 -2
- pytgcalls/methods/internal/handle_mtproto_updates.py +6 -6
- pytgcalls/mtproto/bridged_client.py +9 -2
- pytgcalls/mtproto/client_cache.py +10 -1
- pytgcalls/mtproto/hydrogram_client.py +11 -7
- pytgcalls/mtproto/pyrogram_client.py +12 -7
- pytgcalls/mtproto/telethon_client.py +11 -6
- pytgcalls/types/chats/group_call_participant.py +1 -9
- pytgcalls/types/chats/updated_group_call_participant.py +2 -0
- pytgcalls/types/participant_list.py +2 -1
- {py_tgcalls-2.2.0rc2.dist-info → py_tgcalls-2.2.0rc3.dist-info}/WHEEL +0 -0
- {py_tgcalls-2.2.0rc2.dist-info → py_tgcalls-2.2.0rc3.dist-info}/licenses/LICENSE +0 -0
- {py_tgcalls-2.2.0rc2.dist-info → py_tgcalls-2.2.0rc3.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: py-tgcalls
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.0rc3
|
|
4
4
|
Summary: Async client API for the Telegram Calls.
|
|
5
5
|
Author-email: Laky-64 <iraci.matteo@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://pytgcalls.github.io/
|
|
@@ -20,7 +20,7 @@ Requires-Python: >=3.9
|
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
22
|
Requires-Dist: aiohttp>=3.9.3
|
|
23
|
-
Requires-Dist: ntgcalls<3.0.0,>=2.0.
|
|
23
|
+
Requires-Dist: ntgcalls<3.0.0,>=2.0.0rc5
|
|
24
24
|
Requires-Dist: deprecation
|
|
25
25
|
Provides-Extra: pyrogram
|
|
26
26
|
Requires-Dist: pyrogram>=1.2.20; extra == "pyrogram"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
py_tgcalls-2.2.
|
|
1
|
+
py_tgcalls-2.2.0rc3.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
|
|
2
2
|
pytgcalls/__init__.py,sha256=qbfwN7rYwIdCegMOzdcbvwazeNjDzgmowgcqLFNqKIM,308
|
|
3
|
-
pytgcalls/__version__.py,sha256=
|
|
3
|
+
pytgcalls/__version__.py,sha256=oggK25XEBVcFHD0dtA1CXYnNjf3ynxvgKwJFaniQ3Is,25
|
|
4
4
|
pytgcalls/environment.py,sha256=ctCHACvG6l8SdpPewSBhOvc70kbwpv18maC0TwLvZ08,1924
|
|
5
5
|
pytgcalls/exceptions.py,sha256=Rijc-8T93WEWJxNW9jncU8_M6mYZZZcs8F2bqitEIeI,3787
|
|
6
6
|
pytgcalls/ffmpeg.py,sha256=CZvSyuztc-TGKbKI9_2G7CLITe1ITf315YPyprWu_Pg,8645
|
|
7
|
-
pytgcalls/filters.py,sha256=
|
|
7
|
+
pytgcalls/filters.py,sha256=8Fq_gvHHdqhIk_XwMJ9wneeZOwrvBkSOKaMJ60r3bZU,6157
|
|
8
8
|
pytgcalls/list_to_cmd.py,sha256=rGJLsejbAQdDb8pctMbLnwea5NkitlfVKc3IpoGi4V4,240
|
|
9
9
|
pytgcalls/mtproto_required.py,sha256=6B-31p5qH_6oekUgypV4nK3hqPS6Nr-pA8S81wjnbaY,630
|
|
10
10
|
pytgcalls/mutex.py,sha256=vWqji9IAHtAc61FUTVXncx5rZ3rVf5qG_7PI4LmuYmU,733
|
|
@@ -39,7 +39,7 @@ pytgcalls/methods/internal/clear_call.py,sha256=yElvn3i6_j14Q7n9kcLSl-muYAGcaIZa
|
|
|
39
39
|
pytgcalls/methods/internal/connect_call.py,sha256=Py-sB_ImH839tK9GxNUCJDJUNizsZtlm5m6kuiUX3lE,5739
|
|
40
40
|
pytgcalls/methods/internal/emit_sig_data.py,sha256=ucIsknhJHB-0x7lcymXvwQ647AJQ852zH2W6MdlC3ws,216
|
|
41
41
|
pytgcalls/methods/internal/handle_connection_changed.py,sha256=_1u3J6_Pjl1Gs1u_WkhG2FAUl_hxlHUiflaMkKkJDsc,866
|
|
42
|
-
pytgcalls/methods/internal/handle_mtproto_updates.py,sha256=
|
|
42
|
+
pytgcalls/methods/internal/handle_mtproto_updates.py,sha256=Kt5ioQ-qYHNIwzEwLLsNJBG-INA4vk21t01zCzpy7k0,7722
|
|
43
43
|
pytgcalls/methods/internal/handle_stream_ended.py,sha256=DllD1ZfGQbwVh-S0neocwnN-8lQtwwyrzWl9teSrZbY,561
|
|
44
44
|
pytgcalls/methods/internal/handle_stream_frame.py,sha256=_FA782qlOT3tUqnySm7RBpjbgfEEzt1oEBDm-iADsbQ,1145
|
|
45
45
|
pytgcalls/methods/internal/join_presentation.py,sha256=dLB2kolIIm2KQH8yBQbEPJi_y1_cVLWpE52_Rwjn_KE,2178
|
|
@@ -70,19 +70,19 @@ pytgcalls/methods/utilities/run.py,sha256=cnYQd2xB5Cr_WS0Q2cXJZPGiN6JOCULzj1r4xX
|
|
|
70
70
|
pytgcalls/methods/utilities/start.py,sha256=mn0kQZhTUuc-9CCJDbFIVsEtJ8kfnfZOGbVC505qVRM,3232
|
|
71
71
|
pytgcalls/methods/utilities/stream_params.py,sha256=fOSloo1A7WTxaZEtOiPXjdexMeoJjq8CZtfHuIFX7Ns,3325
|
|
72
72
|
pytgcalls/mtproto/__init__.py,sha256=X4zvzFG7km7qHyE0fdvA550WcOVO_xl_p__gvIfDGmw,130
|
|
73
|
-
pytgcalls/mtproto/bridged_client.py,sha256=
|
|
74
|
-
pytgcalls/mtproto/client_cache.py,sha256=
|
|
75
|
-
pytgcalls/mtproto/hydrogram_client.py,sha256=
|
|
73
|
+
pytgcalls/mtproto/bridged_client.py,sha256=gG69X4tbFKwPiMdBYMEYSSqqB6UcTp1B-HpqqGvOqR4,7005
|
|
74
|
+
pytgcalls/mtproto/client_cache.py,sha256=73o111KTSxGSw1OrG8m4QBnz7VSzETiTLnhEt49IXw0,6595
|
|
75
|
+
pytgcalls/mtproto/hydrogram_client.py,sha256=XKHsyWXJTe5jzo0m-hLxvYaJ_65TOA7W0i4vS3BtxcI,28591
|
|
76
76
|
pytgcalls/mtproto/mtproto_client.py,sha256=95A13HsNJfpNslsY_gWiqYXj_Vvo-pl3rVrsJGxftgg,8517
|
|
77
|
-
pytgcalls/mtproto/pyrogram_client.py,sha256=
|
|
78
|
-
pytgcalls/mtproto/telethon_client.py,sha256=
|
|
77
|
+
pytgcalls/mtproto/pyrogram_client.py,sha256=5KwGuHC21DjUCe_PVQzLyfxrBuxd2h_xlFPDfX813NU,28588
|
|
78
|
+
pytgcalls/mtproto/telethon_client.py,sha256=6dzPXnfy4_fXjNWjRbH0RrWyD2LTQM3WREfFcBDXwEo,26711
|
|
79
79
|
pytgcalls/types/__init__.py,sha256=GlgBBXAwbNopXSeTTmiXktrEJhhN_rMBtuAllTBbN3k,1189
|
|
80
80
|
pytgcalls/types/browsers.py,sha256=47Kr5q96n4Q4WvVhA6IUlS2egEcA9GRLlDeFcQYyc9M,9545
|
|
81
81
|
pytgcalls/types/cache.py,sha256=FfsOcmYnsBGPlJoTPIXXYcUSpGE3rhx6cjIH77hyUL0,1059
|
|
82
82
|
pytgcalls/types/dict.py,sha256=lAo9hu4VlVJa9S7P8Y81BYmKtvz0rH7hwpGcH3ynHUw,78
|
|
83
83
|
pytgcalls/types/flag.py,sha256=dQPcQmTgTQzcOLTvGe8t_e9mY4qsVnCZFrrTk17b2Xw,132
|
|
84
84
|
pytgcalls/types/list.py,sha256=UjP_XxxMpPkLlu6yEy29JYqOM5VITFwwJcDm0wZni1c,78
|
|
85
|
-
pytgcalls/types/participant_list.py,sha256=
|
|
85
|
+
pytgcalls/types/participant_list.py,sha256=60bDaLQ484qgxk2Mm4cxCtlzqVhUTS7itdfQmuZk4PA,949
|
|
86
86
|
pytgcalls/types/py_object.py,sha256=__GNXgffGK4jhdF4QPqIknd0k2myObJf_7fW3pNGpbU,836
|
|
87
87
|
pytgcalls/types/update.py,sha256=wPCzWLhrsScZ3ksRTyt8IuDaaG5YI-ItG_Yw-OqzK2Y,157
|
|
88
88
|
pytgcalls/types/user_agent.py,sha256=sSfeGqUe0v0wqBgdVszNFK0iOC_0Tdyto9CglBXlY4U,1086
|
|
@@ -97,8 +97,8 @@ pytgcalls/types/calls/pending_connection.py,sha256=qRRmutInj70rtzbThM7CNznFhEPqT
|
|
|
97
97
|
pytgcalls/types/calls/raw_call_update.py,sha256=hpNw6HrTW8Z36Lh2HinS-wzprryRtsIxyIFbIfjGgeI,795
|
|
98
98
|
pytgcalls/types/chats/__init__.py,sha256=v8pUp_vbr2kQpyHtAQc80N-YqzmXHe9SbllUsa6njkU,261
|
|
99
99
|
pytgcalls/types/chats/chat_update.py,sha256=lzrqNDPv4a_yXpKIfUnhocXqZyIy8XgZladOQTYrrYA,730
|
|
100
|
-
pytgcalls/types/chats/group_call_participant.py,sha256=
|
|
101
|
-
pytgcalls/types/chats/updated_group_call_participant.py,sha256
|
|
100
|
+
pytgcalls/types/chats/group_call_participant.py,sha256=alFtJcgK7aGJ6rl4QSmHD2pU3IwDVs0ajV6qInOrf0Q,1481
|
|
101
|
+
pytgcalls/types/chats/updated_group_call_participant.py,sha256=bZQsZAsMv_i4k8DJW3phyuHqpa9Dp6IbheHCvj3M630,365
|
|
102
102
|
pytgcalls/types/raw/__init__.py,sha256=ROHsKFeUMUtlFbx2rhfrdB-TuVm0zBuvNo29Ccn5614,308
|
|
103
103
|
pytgcalls/types/raw/audio_parameters.py,sha256=1DsBPwdn_Ukd2Tbkb3whP_ILo9xJY_3XNNmbO4_NO9Q,449
|
|
104
104
|
pytgcalls/types/raw/audio_stream.py,sha256=oN7Sx9oLbNFuNXiGYpoNabMwqWKGquLiHEywef28o7c,488
|
|
@@ -116,7 +116,7 @@ pytgcalls/types/stream/record_stream.py,sha256=f4VQ6MY8HtOxt7vz0hWBFmbbAIvTRHpAI
|
|
|
116
116
|
pytgcalls/types/stream/stream_ended.py,sha256=xR_kZwFf03hA6rw_nvI7Be7GwoCKzQf_1MKaGpPDXqY,716
|
|
117
117
|
pytgcalls/types/stream/stream_frames.py,sha256=028ZhNV-mN3BGqMlmxusAV1xDQpXRYCeM0WXBZhRUhA,446
|
|
118
118
|
pytgcalls/types/stream/video_quality.py,sha256=HBfWq005kh-D19MaVE9VzVdnODzrXf4IJUimCfslfiU,231
|
|
119
|
-
py_tgcalls-2.2.
|
|
120
|
-
py_tgcalls-2.2.
|
|
121
|
-
py_tgcalls-2.2.
|
|
122
|
-
py_tgcalls-2.2.
|
|
119
|
+
py_tgcalls-2.2.0rc3.dist-info/METADATA,sha256=xjnla12jR6aBXMOTcFV1k7gNUuQO7Lzdus2L7AX3EbM,5286
|
|
120
|
+
py_tgcalls-2.2.0rc3.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
|
121
|
+
py_tgcalls-2.2.0rc3.dist-info/top_level.txt,sha256=IUDUwn0KkcbUYZbCe9R5AUb2Ob-lmllNUGQqyeXXd8A,10
|
|
122
|
+
py_tgcalls-2.2.0rc3.dist-info/RECORD,,
|
pytgcalls/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '2.2.
|
|
1
|
+
__version__ = '2.2.0rc3'
|
pytgcalls/filters.py
CHANGED
|
@@ -158,6 +158,7 @@ class stream_end(Filter):
|
|
|
158
158
|
self.device & update.device
|
|
159
159
|
)
|
|
160
160
|
)
|
|
161
|
+
return False
|
|
161
162
|
|
|
162
163
|
|
|
163
164
|
# noinspection PyPep8Naming
|
|
@@ -190,14 +191,17 @@ class chat_update(Filter):
|
|
|
190
191
|
|
|
191
192
|
# noinspection PyPep8Naming
|
|
192
193
|
class call_participant(Filter):
|
|
193
|
-
def __init__(
|
|
194
|
+
def __init__(
|
|
195
|
+
self,
|
|
196
|
+
flags: Optional[GroupCallParticipant.Action] = None,
|
|
197
|
+
):
|
|
194
198
|
self.flags = flags
|
|
195
199
|
|
|
196
200
|
async def __call__(self, client: PyTgCalls, update: Update):
|
|
197
201
|
if isinstance(update, UpdatedGroupCallParticipant):
|
|
198
202
|
if self.flags is None:
|
|
199
203
|
return True
|
|
200
|
-
return self.flags & update.
|
|
204
|
+
return self.flags & update.action
|
|
201
205
|
return False
|
|
202
206
|
|
|
203
207
|
|
|
@@ -72,7 +72,7 @@ class HandleMTProtoUpdates(Scaffold):
|
|
|
72
72
|
await self._clear_call(chat_id)
|
|
73
73
|
if isinstance(update, UpdatedGroupCallParticipant):
|
|
74
74
|
participant = update.participant
|
|
75
|
-
action =
|
|
75
|
+
action = update.action
|
|
76
76
|
chat_peer = self._cache_user_peer.get(chat_id)
|
|
77
77
|
user_id = participant.user_id
|
|
78
78
|
if chat_id in self._call_sources:
|
|
@@ -151,9 +151,9 @@ class HandleMTProtoUpdates(Scaffold):
|
|
|
151
151
|
self,
|
|
152
152
|
)
|
|
153
153
|
if (
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
chat_id in self._need_unmute and
|
|
155
|
+
action == GroupCallParticipant.Action.UPDATED
|
|
156
|
+
and not participant.muted_by_admin
|
|
157
157
|
):
|
|
158
158
|
await self._update_status(
|
|
159
159
|
chat_id,
|
|
@@ -162,8 +162,8 @@ class HandleMTProtoUpdates(Scaffold):
|
|
|
162
162
|
await self._switch_connection(chat_id)
|
|
163
163
|
|
|
164
164
|
if (
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
participant.muted_by_admin and
|
|
166
|
+
action != GroupCallParticipant.Action.LEFT
|
|
167
167
|
):
|
|
168
168
|
self._need_unmute.add(chat_id)
|
|
169
169
|
else:
|
|
@@ -190,13 +190,20 @@ class BridgedClient(HandlersHolder):
|
|
|
190
190
|
bool(participant.raise_hand_rating),
|
|
191
191
|
participant.volume // 100
|
|
192
192
|
if participant.volume is not None else 100,
|
|
193
|
-
bool(participant.just_joined),
|
|
194
|
-
bool(participant.left),
|
|
195
193
|
participant.source,
|
|
196
194
|
BridgedClient.parse_source(participant.video),
|
|
197
195
|
BridgedClient.parse_source(participant.presentation),
|
|
198
196
|
)
|
|
199
197
|
|
|
198
|
+
@staticmethod
|
|
199
|
+
def parse_participant_action(participant):
|
|
200
|
+
if participant.just_joined:
|
|
201
|
+
return GroupCallParticipant.Action.JOINED
|
|
202
|
+
elif participant.left:
|
|
203
|
+
return GroupCallParticipant.Action.LEFT
|
|
204
|
+
else:
|
|
205
|
+
return GroupCallParticipant.Action.UPDATED
|
|
206
|
+
|
|
200
207
|
@staticmethod
|
|
201
208
|
def chat_id(input_peer) -> int:
|
|
202
209
|
class_name = input_peer.__class__.__name__
|
|
@@ -49,12 +49,14 @@ class ClientCache:
|
|
|
49
49
|
def set_participants_cache_call(
|
|
50
50
|
self,
|
|
51
51
|
input_id: int,
|
|
52
|
+
action: GroupCallParticipant.Action,
|
|
52
53
|
participant: GroupCallParticipant,
|
|
53
54
|
) -> Optional[GroupCallParticipant]:
|
|
54
55
|
chat_id = self.get_chat_id(input_id)
|
|
55
56
|
if chat_id is not None:
|
|
56
57
|
return self._internal_set_participants_cache(
|
|
57
58
|
chat_id,
|
|
59
|
+
action,
|
|
58
60
|
participant,
|
|
59
61
|
)
|
|
60
62
|
return None
|
|
@@ -63,6 +65,7 @@ class ClientCache:
|
|
|
63
65
|
self,
|
|
64
66
|
chat_id: int,
|
|
65
67
|
call_id: int,
|
|
68
|
+
action: GroupCallParticipant.Action,
|
|
66
69
|
participant: GroupCallParticipant,
|
|
67
70
|
) -> Optional[GroupCallParticipant]:
|
|
68
71
|
if self._call_participants_cache.get(chat_id) is None:
|
|
@@ -74,12 +77,14 @@ class ClientCache:
|
|
|
74
77
|
)
|
|
75
78
|
return self._internal_set_participants_cache(
|
|
76
79
|
chat_id,
|
|
80
|
+
action,
|
|
77
81
|
participant,
|
|
78
82
|
)
|
|
79
83
|
|
|
80
84
|
def _internal_set_participants_cache(
|
|
81
85
|
self,
|
|
82
86
|
chat_id: int,
|
|
87
|
+
action: GroupCallParticipant.Action,
|
|
83
88
|
participant: GroupCallParticipant,
|
|
84
89
|
) -> Optional[GroupCallParticipant]:
|
|
85
90
|
participants: Optional[
|
|
@@ -91,7 +96,10 @@ class ClientCache:
|
|
|
91
96
|
participants.last_mtproto_update = (
|
|
92
97
|
int(time()) + self._cache_duration
|
|
93
98
|
)
|
|
94
|
-
return participants.update_participant(
|
|
99
|
+
return participants.update_participant(
|
|
100
|
+
action,
|
|
101
|
+
participant,
|
|
102
|
+
)
|
|
95
103
|
return None
|
|
96
104
|
|
|
97
105
|
async def get_participant_list(
|
|
@@ -121,6 +129,7 @@ class ClientCache:
|
|
|
121
129
|
for participant in list_participants:
|
|
122
130
|
self.set_participants_cache_call(
|
|
123
131
|
input_call.id,
|
|
132
|
+
GroupCallParticipant.Action.UPDATED,
|
|
124
133
|
participant,
|
|
125
134
|
)
|
|
126
135
|
except Exception as e:
|
|
@@ -94,7 +94,7 @@ class HydrogramClient(BridgedClient):
|
|
|
94
94
|
self,
|
|
95
95
|
)
|
|
96
96
|
|
|
97
|
-
@self._app.on_raw_update(group=-
|
|
97
|
+
@self._app.on_raw_update(group=-9999)
|
|
98
98
|
async def on_update(_, update, __, chats):
|
|
99
99
|
if isinstance(
|
|
100
100
|
update,
|
|
@@ -188,14 +188,17 @@ class HydrogramClient(BridgedClient):
|
|
|
188
188
|
):
|
|
189
189
|
participants = update.participants
|
|
190
190
|
for participant in participants:
|
|
191
|
+
action = self.parse_participant_action(participant)
|
|
191
192
|
result = self._cache.set_participants_cache_call(
|
|
192
193
|
update.call.id,
|
|
194
|
+
action,
|
|
193
195
|
self.parse_participant(participant),
|
|
194
196
|
)
|
|
195
197
|
if result is not None:
|
|
196
198
|
await self._propagate(
|
|
197
199
|
UpdatedGroupCallParticipant(
|
|
198
200
|
self._cache.get_chat_id(update.call.id),
|
|
201
|
+
action,
|
|
199
202
|
result,
|
|
200
203
|
),
|
|
201
204
|
)
|
|
@@ -355,6 +358,7 @@ class HydrogramClient(BridgedClient):
|
|
|
355
358
|
self._cache.set_participants_cache_chat(
|
|
356
359
|
chat_id,
|
|
357
360
|
call.id,
|
|
361
|
+
self.parse_participant_action(participant),
|
|
358
362
|
self.parse_participant(participant),
|
|
359
363
|
)
|
|
360
364
|
if call.schedule_date is not None:
|
|
@@ -431,6 +435,7 @@ class HydrogramClient(BridgedClient):
|
|
|
431
435
|
for participant in participants:
|
|
432
436
|
self._cache.set_participants_cache_call(
|
|
433
437
|
update.call.id,
|
|
438
|
+
self.parse_participant_action(participant),
|
|
434
439
|
self.parse_participant(participant),
|
|
435
440
|
)
|
|
436
441
|
if isinstance(update, UpdateGroupCallConnection):
|
|
@@ -734,7 +739,6 @@ class HydrogramClient(BridgedClient):
|
|
|
734
739
|
):
|
|
735
740
|
if chat_id is not None:
|
|
736
741
|
dc_id = self._cache.get_dc_call(chat_id)
|
|
737
|
-
|
|
738
742
|
if dc_id is None:
|
|
739
743
|
session = self._app
|
|
740
744
|
else:
|
|
@@ -784,12 +788,12 @@ class HydrogramClient(BridgedClient):
|
|
|
784
788
|
dc_new = BridgedClient.extract_dc(
|
|
785
789
|
str(e),
|
|
786
790
|
)
|
|
787
|
-
if chat_id is not None and dc_new is not None:
|
|
788
|
-
self._cache.set_dc_call(
|
|
789
|
-
chat_id,
|
|
790
|
-
dc_new,
|
|
791
|
-
)
|
|
792
791
|
if dc_new is not None:
|
|
792
|
+
if chat_id is not None:
|
|
793
|
+
self._cache.set_dc_call(
|
|
794
|
+
chat_id,
|
|
795
|
+
dc_new,
|
|
796
|
+
)
|
|
793
797
|
return await self._invoke(
|
|
794
798
|
request,
|
|
795
799
|
dc_new,
|
|
@@ -94,7 +94,7 @@ class PyrogramClient(BridgedClient):
|
|
|
94
94
|
self,
|
|
95
95
|
)
|
|
96
96
|
|
|
97
|
-
@self._app.on_raw_update(group=-
|
|
97
|
+
@self._app.on_raw_update(group=-9999)
|
|
98
98
|
async def on_update(_, update, __, chats):
|
|
99
99
|
if isinstance(
|
|
100
100
|
update,
|
|
@@ -188,17 +188,21 @@ class PyrogramClient(BridgedClient):
|
|
|
188
188
|
):
|
|
189
189
|
participants = update.participants
|
|
190
190
|
for participant in participants:
|
|
191
|
+
action = self.parse_participant_action(participant)
|
|
191
192
|
result = self._cache.set_participants_cache_call(
|
|
192
193
|
update.call.id,
|
|
194
|
+
action,
|
|
193
195
|
self.parse_participant(participant),
|
|
194
196
|
)
|
|
195
197
|
if result is not None:
|
|
196
198
|
await self._propagate(
|
|
197
199
|
UpdatedGroupCallParticipant(
|
|
198
200
|
self._cache.get_chat_id(update.call.id),
|
|
201
|
+
action,
|
|
199
202
|
result,
|
|
200
203
|
),
|
|
201
204
|
)
|
|
205
|
+
|
|
202
206
|
if isinstance(
|
|
203
207
|
update,
|
|
204
208
|
UpdateGroupCall,
|
|
@@ -355,6 +359,7 @@ class PyrogramClient(BridgedClient):
|
|
|
355
359
|
self._cache.set_participants_cache_chat(
|
|
356
360
|
chat_id,
|
|
357
361
|
call.id,
|
|
362
|
+
self.parse_participant_action(participant),
|
|
358
363
|
self.parse_participant(participant),
|
|
359
364
|
)
|
|
360
365
|
if call.schedule_date is not None:
|
|
@@ -431,6 +436,7 @@ class PyrogramClient(BridgedClient):
|
|
|
431
436
|
for participant in participants:
|
|
432
437
|
self._cache.set_participants_cache_call(
|
|
433
438
|
update.call.id,
|
|
439
|
+
self.parse_participant_action(participant),
|
|
434
440
|
self.parse_participant(participant),
|
|
435
441
|
)
|
|
436
442
|
if isinstance(update, UpdateGroupCallConnection):
|
|
@@ -736,7 +742,6 @@ class PyrogramClient(BridgedClient):
|
|
|
736
742
|
):
|
|
737
743
|
if chat_id is not None:
|
|
738
744
|
dc_id = self._cache.get_dc_call(chat_id)
|
|
739
|
-
|
|
740
745
|
if dc_id is None:
|
|
741
746
|
session = self._app
|
|
742
747
|
else:
|
|
@@ -786,12 +791,12 @@ class PyrogramClient(BridgedClient):
|
|
|
786
791
|
dc_new = BridgedClient.extract_dc(
|
|
787
792
|
str(e),
|
|
788
793
|
)
|
|
789
|
-
if chat_id is not None and dc_new is not None:
|
|
790
|
-
self._cache.set_dc_call(
|
|
791
|
-
chat_id,
|
|
792
|
-
dc_new,
|
|
793
|
-
)
|
|
794
794
|
if dc_new is not None:
|
|
795
|
+
if chat_id is not None:
|
|
796
|
+
self._cache.set_dc_call(
|
|
797
|
+
chat_id,
|
|
798
|
+
dc_new,
|
|
799
|
+
)
|
|
795
800
|
return await self._invoke(
|
|
796
801
|
request,
|
|
797
802
|
dc_new,
|
|
@@ -182,14 +182,17 @@ class TelethonClient(BridgedClient):
|
|
|
182
182
|
):
|
|
183
183
|
participants = update.participants
|
|
184
184
|
for participant in participants:
|
|
185
|
+
action = self.parse_participant_action(participant)
|
|
185
186
|
result = self._cache.set_participants_cache_call(
|
|
186
187
|
update.call.id,
|
|
188
|
+
action,
|
|
187
189
|
self.parse_participant(participant),
|
|
188
190
|
)
|
|
189
191
|
if result is not None:
|
|
190
192
|
await self._propagate(
|
|
191
193
|
UpdatedGroupCallParticipant(
|
|
192
194
|
self._cache.get_chat_id(update.call.id),
|
|
195
|
+
action,
|
|
193
196
|
result,
|
|
194
197
|
),
|
|
195
198
|
)
|
|
@@ -342,6 +345,7 @@ class TelethonClient(BridgedClient):
|
|
|
342
345
|
self._cache.set_participants_cache_chat(
|
|
343
346
|
chat_id,
|
|
344
347
|
call.id,
|
|
348
|
+
self.parse_participant_action(participant),
|
|
345
349
|
self.parse_participant(participant),
|
|
346
350
|
)
|
|
347
351
|
if call.schedule_date is not None:
|
|
@@ -418,6 +422,7 @@ class TelethonClient(BridgedClient):
|
|
|
418
422
|
for participant in participants:
|
|
419
423
|
self._cache.set_participants_cache_call(
|
|
420
424
|
update.call.id,
|
|
425
|
+
self.parse_participant_action(participant),
|
|
421
426
|
self.parse_participant(participant),
|
|
422
427
|
)
|
|
423
428
|
if isinstance(update, UpdateGroupCallConnection):
|
|
@@ -714,7 +719,7 @@ class TelethonClient(BridgedClient):
|
|
|
714
719
|
def no_updates(self):
|
|
715
720
|
return False
|
|
716
721
|
|
|
717
|
-
# noinspection PyProtectedMember
|
|
722
|
+
# noinspection PyProtectedMember,PyUnresolvedReferences
|
|
718
723
|
async def _invoke(
|
|
719
724
|
self,
|
|
720
725
|
request,
|
|
@@ -738,12 +743,12 @@ class TelethonClient(BridgedClient):
|
|
|
738
743
|
dc_new = BridgedClient.extract_dc(
|
|
739
744
|
str(e),
|
|
740
745
|
)
|
|
741
|
-
if chat_id is not None and dc_new is not None:
|
|
742
|
-
self._cache.set_dc_call(
|
|
743
|
-
chat_id,
|
|
744
|
-
dc_new,
|
|
745
|
-
)
|
|
746
746
|
if dc_new is not None:
|
|
747
|
+
if chat_id is not None:
|
|
748
|
+
self._cache.set_dc_call(
|
|
749
|
+
chat_id,
|
|
750
|
+
dc_new,
|
|
751
|
+
)
|
|
747
752
|
return await self._invoke(
|
|
748
753
|
request,
|
|
749
754
|
dc_new,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
from enum import auto
|
|
2
|
+
from enum import Flag
|
|
2
3
|
from typing import List
|
|
3
4
|
from typing import Optional
|
|
4
5
|
|
|
5
6
|
from ntgcalls import SsrcGroup
|
|
6
7
|
|
|
7
8
|
from ...types.py_object import PyObject
|
|
8
|
-
from ..flag import Flag
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class GroupCallParticipant(PyObject):
|
|
@@ -33,8 +33,6 @@ class GroupCallParticipant(PyObject):
|
|
|
33
33
|
video_camera: bool,
|
|
34
34
|
raised_hand: bool,
|
|
35
35
|
volume: int,
|
|
36
|
-
joined: bool,
|
|
37
|
-
left: bool,
|
|
38
36
|
source: int,
|
|
39
37
|
video_info: Optional[SourceInfo],
|
|
40
38
|
presentation_info: Optional[SourceInfo],
|
|
@@ -48,12 +46,6 @@ class GroupCallParticipant(PyObject):
|
|
|
48
46
|
self.video_camera: bool = video_camera
|
|
49
47
|
self.raised_hand: bool = raised_hand
|
|
50
48
|
self.volume: int = volume
|
|
51
|
-
if joined:
|
|
52
|
-
self.action = self.Action.JOINED
|
|
53
|
-
elif left:
|
|
54
|
-
self.action = self.Action.LEFT
|
|
55
|
-
else:
|
|
56
|
-
self.action = self.Action.UPDATED
|
|
57
49
|
self.video_info: Optional[
|
|
58
50
|
GroupCallParticipant.SourceInfo
|
|
59
51
|
] = video_info
|
|
@@ -15,9 +15,10 @@ class ParticipantList:
|
|
|
15
15
|
|
|
16
16
|
def update_participant(
|
|
17
17
|
self,
|
|
18
|
+
action: GroupCallParticipant.Action,
|
|
18
19
|
participant: GroupCallParticipant,
|
|
19
20
|
):
|
|
20
|
-
if
|
|
21
|
+
if action == GroupCallParticipant.Action.LEFT:
|
|
21
22
|
if participant.user_id in self._list_participants:
|
|
22
23
|
del self._list_participants[participant.user_id]
|
|
23
24
|
else:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|