summary refs log tree commit diff
path: root/synapse/api/events/utils.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-06 16:59:13 +0000
committerErik Johnston <erik@matrix.org>2014-11-06 16:59:13 +0000
commit351c64e99e5677096f9a2ae2cd7e84dbc1887878 (patch)
treebac8773d7d9b114bb48af789a942967d450c7bd1 /synapse/api/events/utils.py
parentUpdate to use replaces_state rather than prev_state (diff)
downloadsynapse-351c64e99e5677096f9a2ae2cd7e84dbc1887878.tar.xz
Amalgamate all power levels.
Remove concept of reqired power levels, something similiar can be done
using the new power level event.
Diffstat (limited to 'synapse/api/events/utils.py')
-rw-r--r--synapse/api/events/utils.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/synapse/api/events/utils.py b/synapse/api/events/utils.py
index 31601fd3a9..5fc79105b5 100644
--- a/synapse/api/events/utils.py
+++ b/synapse/api/events/utils.py
@@ -15,7 +15,6 @@
 
 from .room import (
     RoomMemberEvent, RoomJoinRulesEvent, RoomPowerLevelsEvent,
-    RoomAddStateLevelEvent, RoomSendEventLevelEvent, RoomOpsPowerLevelsEvent,
     RoomAliasesEvent, RoomCreateEvent,
 )
 
@@ -52,17 +51,17 @@ def _prune_event_or_pdu(event_type, event):
     elif event_type == RoomJoinRulesEvent.TYPE:
         add_fields("join_rule")
     elif event_type == RoomPowerLevelsEvent.TYPE:
-        # TODO: Actually check these are valid user_ids etc.
-        add_fields("default")
-        for k, v in event.content.items():
-            if k.startswith("@") and isinstance(v, (int, long)):
-                new_content[k] = v
-    elif event_type == RoomAddStateLevelEvent.TYPE:
-        add_fields("level")
-    elif event_type == RoomSendEventLevelEvent.TYPE:
-        add_fields("level")
-    elif event_type == RoomOpsPowerLevelsEvent.TYPE:
-        add_fields("kick_level", "ban_level", "redact_level")
+        add_fields(
+            "users",
+            "users_default",
+            "events",
+            "events_default",
+            "events_default",
+            "state_default",
+            "ban",
+            "kick",
+            "redact",
+        )
     elif event_type == RoomAliasesEvent.TYPE:
         add_fields("aliases")