summary refs log tree commit diff
path: root/synapse/handlers/sync.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/handlers/sync.py')
-rw-r--r--synapse/handlers/sync.py30
1 files changed, 3 insertions, 27 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py

index f3039c3c3f..d004c42885 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py
@@ -13,17 +13,7 @@ # limitations under the License. import itertools import logging -from typing import ( - TYPE_CHECKING, - Any, - Collection, - Dict, - FrozenSet, - List, - Optional, - Set, - Tuple, -) +from typing import TYPE_CHECKING, Any, Dict, FrozenSet, List, Optional, Set, Tuple import attr from prometheus_client import Counter @@ -39,6 +29,7 @@ from synapse.push.clientformat import format_push_rules_for_user from synapse.storage.roommember import MemberSummary from synapse.storage.state import StateFilter from synapse.types import ( + DeviceLists, JsonDict, MutableStateMap, Requester, @@ -183,21 +174,6 @@ class GroupsSyncResult: return bool(self.join or self.invite or self.leave) -@attr.s(slots=True, frozen=True, auto_attribs=True) -class DeviceLists: - """ - Attributes: - changed: List of user_ids whose devices may have changed - left: List of user_ids whose devices we no longer track - """ - - changed: Collection[str] - left: Collection[str] - - def __bool__(self) -> bool: - return bool(self.changed or self.left) - - @attr.s(slots=True, auto_attribs=True) class _RoomChanges: """The set of room entries to include in the sync, plus the set of joined @@ -1329,7 +1305,7 @@ class SyncHandler: return DeviceLists(changed=users_that_have_changed, left=newly_left_users) else: - return DeviceLists(changed=[], left=[]) + return DeviceLists() async def _generate_sync_entry_for_to_device( self, sync_result_builder: "SyncResultBuilder"