summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-06-07 10:57:39 +0100
committerErik Johnston <erik@matrix.org>2019-06-07 12:15:28 +0100
commit928d1ccd73ddce5af99539ad800987d2f5bd2942 (patch)
treebbfd05fd5e7ba68c4842d39f8d08410dda3bb66b /synapse
parentAutomatically retry builds when a buildkite agent is lost (#5380) (diff)
downloadsynapse-928d1ccd73ddce5af99539ad800987d2f5bd2942.tar.xz
Fix email notifications for large unnamed rooms.
When we try and calculate a description for a room for with no name but
multiple other users we threw an exception (due to trying to subscript
result of `dict.values()`).
Diffstat (limited to 'synapse')
-rw-r--r--synapse/push/presentable_names.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/push/presentable_names.py b/synapse/push/presentable_names.py
index eef6e18c2e..0c66702325 100644
--- a/synapse/push/presentable_names.py
+++ b/synapse/push/presentable_names.py
@@ -162,6 +162,17 @@ def calculate_room_name(store, room_state_ids, user_id, fallback_to_members=True
 
 
 def descriptor_from_member_events(member_events):
+    """Get a description of the room based on the member events.
+
+    Args:
+        member_events (Iterable[FrozenEvent])
+
+    Returns:
+        str
+    """
+
+    member_events = list(member_events)
+
     if len(member_events) == 0:
         return "nobody"
     elif len(member_events) == 1: