This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -701,7 +701,7 @@ async def compute_summary(
701
701
name_id = state_ids .get ((EventTypes .Name , "" ))
702
702
canonical_alias_id = state_ids .get ((EventTypes .CanonicalAlias , "" ))
703
703
704
- summary = {}
704
+ summary : JsonDict = {}
705
705
empty_ms = MemberSummary ([], 0 )
706
706
707
707
# TODO: only send these when they change.
Original file line number Diff line number Diff line change 14
14
# limitations under the License.
15
15
16
16
import logging
17
- from collections import namedtuple
18
- from typing import Optional
17
+ from typing import List , Optional , Tuple
19
18
20
19
import attr
21
20
@@ -45,7 +44,10 @@ class ProfileInfo:
45
44
display_name : Optional [str ]
46
45
47
46
48
- # "members" points to a truncated list of (user_id, event_id) tuples for users of
49
- # a given membership type, suitable for use in calculating heroes for a room.
50
- # "count" points to the total numberr of users of a given membership type.
51
- MemberSummary = namedtuple ("MemberSummary" , ("members" , "count" ))
47
+ @attr .s (slots = True , frozen = True , auto_attribs = True )
48
+ class MemberSummary :
49
+ # A truncated list of (user_id, event_id) tuples for users of a given
50
+ # membership type, suitable for use in calculating heroes for a room.
51
+ members : List [Tuple [str , str ]]
52
+ # The total number of users of a given membership type.
53
+ count : int
You can’t perform that action at this time.
0 commit comments