mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Remove duplicate checks
This commit is contained in:
parent
9fa3c6ffa3
commit
40638ae7f5
@ -54,20 +54,6 @@ class EventValidator(object):
|
|||||||
if not isinstance(getattr(event, s), string_types):
|
if not isinstance(getattr(event, s), string_types):
|
||||||
raise SynapseError(400, "'%s' not a string type" % (s,))
|
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):
|
def validate_builder(self, event):
|
||||||
"""Validates that the builder/event has roughly the right format. Only
|
"""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
|
checks values that we expect a proto event to have, rather than all the
|
||||||
|
Loading…
Reference in New Issue
Block a user