Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 5d70b68

Browse files
committed
Clean up some docstrings
1 parent 7bf663a commit 5d70b68

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

synapse/handlers/appservice.py

+7-18
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,12 @@ def notify_interested_services_ephemeral(
205205
users: Collection[Union[str, UserID]],
206206
) -> None:
207207
"""
208-
This is called by the notifier in the background when
209-
an ephemeral event is handled by the homeserver.
208+
This is called by the notifier in the background when an ephemeral event is handled
209+
by the homeserver.
210210
211-
This will determine which appservices are
212-
interested in the event, and submit them.
211+
This will determine which appservices are interested in the event, and submit them.
213212
214-
Events will only be pushed to appservices
215-
that have opted into ephemeral events
213+
Events will only be pushed to appservices that have opted into ephemeral events
216214
217215
Args:
218216
stream_key: The stream the event came from.
@@ -225,7 +223,7 @@ def notify_interested_services_ephemeral(
225223
`msc2409_to_device_messages_enabled` config option is set to true.
226224
227225
Ephemeral events will only be pushed to appservices that have opted into
228-
them.
226+
them with the ephemeral registration file option enabled.
229227
230228
Appservices will only receive ephemeral events that fall within their
231229
registered user and room namespaces.
@@ -345,7 +343,7 @@ async def _notify_interested_services_ephemeral(
345343
and self.msc2409_to_device_messages_enabled
346344
):
347345
# Retrieve an iterable of to-device message events, as well as the
348-
# maximum stream token we were able to retrieve.
346+
# maximum stream token of the messages we were able to retrieve.
349347
events, max_stream_token = await self._handle_to_device(
350348
service, new_token, users
351349
)
@@ -356,6 +354,7 @@ async def _notify_interested_services_ephemeral(
356354

357355
# TODO: If max_stream_token != new_token, schedule another transaction immediately,
358356
# instead of waiting for another to-device to be sent?
357+
# https://github.com/matrix-org/synapse/issues/11150#issuecomment-960726449
359358

360359
# Persist the latest handled stream token for this appservice
361360
await self.store.set_type_stream_id_for_appservice(
@@ -416,16 +415,6 @@ async def _handle_to_device(
416415
limit=MAX_TO_DEVICE_MESSAGES_PER_AS_TRANSACTION,
417416
)
418417

419-
logger.info(
420-
"*** Users: %s, from: %s, to: %s",
421-
users_appservice_is_interested_in,
422-
from_key,
423-
new_token,
424-
)
425-
logger.info(
426-
"*** Got to-device message: %s", recipient_user_id_device_id_to_messages
427-
)
428-
429418
# According to MSC2409, we'll need to add 'to_user_id' and 'to_device_id' fields
430419
# to the event JSON so that the application service will know which user/device
431420
# combination this messages was intended for.

synapse/handlers/receipts.py

-4
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,6 @@ async def get_new_events_as(
267267
)
268268

269269
# Then filter down to rooms that the AS can read
270-
# TODO: This doesn't seem to honour an appservice's registration of room or
271-
# namespace aliases. For instance, if an appservice registered a room namespace
272-
# that matched this room, but it didn't have any members in the room, then that
273-
# appservice wouldn't receive the read receipt.
274270
events = []
275271
for room_id, event in rooms_to_events.items():
276272
if not await service.matches_user_in_member_list(room_id, self.store):

0 commit comments

Comments
 (0)