0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-06-16 01:28:32 +02:00

Remove duplicate checks

This commit is contained in:
Erik Johnston 2019-01-29 10:37:40 +00:00
parent 9fa3c6ffa3
commit 40638ae7f5

View file

@ -54,20 +54,6 @@ class EventValidator(object):
if not isinstance(getattr(event, s), string_types):
raise SynapseError(400, "'%s' not a string type" % (s,))
if event.type == EventTypes.Message:
content_strings = [
"body",
"msgtype",
]
self._ensure_strings(event.content, content_strings)
elif event.type == EventTypes.Topic:
self._ensure_strings(event.content, ["topic"])
elif event.type == EventTypes.Name:
self._ensure_strings(event.content, ["name"])
def validate_builder(self, event):
"""Validates that the builder/event has roughly the right format. Only
checks values that we expect a proto event to have, rather than all the