mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 04:24:56 -04:00
Additional constants for EDU types. (#12884)
Instead of hard-coding strings in many places.
This commit is contained in:
parent
d9f092285b
commit
c52abc1cfd
35 changed files with 146 additions and 96 deletions
|
@ -16,6 +16,7 @@ from typing import TYPE_CHECKING, List
|
|||
|
||||
from prometheus_client import Gauge
|
||||
|
||||
from synapse.api.constants import EduTypes
|
||||
from synapse.api.errors import HttpResponseException
|
||||
from synapse.events import EventBase
|
||||
from synapse.federation.persistence import TransactionActions
|
||||
|
@ -126,7 +127,10 @@ class TransactionManager:
|
|||
len(edus),
|
||||
)
|
||||
if issue_8631_logger.isEnabledFor(logging.DEBUG):
|
||||
DEVICE_UPDATE_EDUS = {"m.device_list_update", "m.signing_key_update"}
|
||||
DEVICE_UPDATE_EDUS = {
|
||||
EduTypes.DEVICE_LIST_UPDATE,
|
||||
EduTypes.SIGNING_KEY_UPDATE,
|
||||
}
|
||||
device_list_updates = [
|
||||
edu.content for edu in edus if edu.edu_type in DEVICE_UPDATE_EDUS
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue