Add method to get current server time in milliseconds in ModuleApi (#18144)

- Add `get_current_time_msec()` method to the [module
API](https://matrix-org.github.io/synapse/latest/modules/writing_a_module.html)
for sound time comparisons with Synapse.
- Fixes #18104 

Signed-off-by: Ahmed Qashlan <ahmedelqashlan@gmail.com>
Co-authored-by: Eric Eastwood <madlittlemods@gmail.com>
Co-authored-by: Erik Johnston <erikj@jki.re>
This commit is contained in:
qashlan 2025-02-18 12:20:30 +02:00 committed by GitHub
parent 12dc6b102f
commit 2d4f28915e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View file

@ -0,0 +1 @@
Add `get_current_time_msec()` method to the [module API](https://matrix-org.github.io/synapse/latest/modules/writing_a_module.html) for sound time comparisons with Synapse.

View file

@ -1846,6 +1846,10 @@ class ModuleApi:
deactivation=deactivation,
)
def get_current_time_msec(self) -> int:
"""Returns the current server time in milliseconds."""
return self._clock.time_msec()
class PublicRoomListManager:
"""Contains methods for adding to, removing from and querying whether a room