Additional constants for EDU types. (#12884)

Instead of hard-coding strings in many places.
This commit is contained in:
Patrick Cloke 2022-05-27 07:14:36 -04:00 committed by GitHub
parent d9f092285b
commit c52abc1cfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 146 additions and 96 deletions

View file

@ -28,6 +28,7 @@ from typing import (
cast,
)
from synapse.api.constants import EduTypes
from synapse.api.errors import Codes, StoreError
from synapse.logging.opentracing import (
get_active_span_text_map,
@ -419,7 +420,7 @@ class DeviceWorkerStore(SQLBaseStore):
# Add the updated cross-signing keys to the results list
for user_id, result in cross_signing_keys_by_user.items():
result["user_id"] = user_id
results.append(("m.signing_key_update", result))
results.append((EduTypes.SIGNING_KEY_UPDATE, result))
# also send the unstable version
# FIXME: remove this when enough servers have upgraded
# and remove the length budgeting above.
@ -545,7 +546,7 @@ class DeviceWorkerStore(SQLBaseStore):
else:
result["deleted"] = True
results.append(("m.device_list_update", result))
results.append((EduTypes.DEVICE_LIST_UPDATE, result))
return results