|
21 | 21 | import attr |
22 | 22 | from prometheus_client import Counter |
23 | 23 |
|
| 24 | +from synapse.api.constants import EduTypes |
24 | 25 | from synapse.api.errors import ( |
25 | 26 | FederationDeniedError, |
26 | 27 | HttpResponseException, |
@@ -542,7 +543,7 @@ def _get_rr_edus(self, force_flush: bool) -> Iterable[Edu]: |
542 | 543 | edu = Edu( |
543 | 544 | origin=self._server_name, |
544 | 545 | destination=self._destination, |
545 | | - edu_type="m.receipt", |
| 546 | + edu_type=EduTypes.RECEIPT, |
546 | 547 | content=self._pending_rrs, |
547 | 548 | ) |
548 | 549 | self._pending_rrs = {} |
@@ -592,7 +593,7 @@ async def _get_to_device_message_edus(self, limit: int) -> Tuple[List[Edu], int] |
592 | 593 | Edu( |
593 | 594 | origin=self._server_name, |
594 | 595 | destination=self._destination, |
595 | | - edu_type="m.direct_to_device", |
| 596 | + edu_type=EduTypes.DIRECT_TO_DEVICE, |
596 | 597 | content=content, |
597 | 598 | ) |
598 | 599 | for content in contents |
@@ -670,7 +671,7 @@ async def __aenter__(self) -> Tuple[List[EventBase], List[Edu]]: |
670 | 671 | Edu( |
671 | 672 | origin=self.queue._server_name, |
672 | 673 | destination=self.queue._destination, |
673 | | - edu_type="m.presence", |
| 674 | + edu_type=EduTypes.PRESENCE, |
674 | 675 | content={ |
675 | 676 | "push": [ |
676 | 677 | format_user_presence_state( |
|
0 commit comments