diff --git a/changelog.d/18135.bugfix b/changelog.d/18135.bugfix new file mode 100644 index 00000000000..998914a8116 --- /dev/null +++ b/changelog.d/18135.bugfix @@ -0,0 +1 @@ +Fix user directory search when using a legacy module with a `check_username_for_spam` callback. Broke in v1.122.0. diff --git a/synapse/module_api/callbacks/spamchecker_callbacks.py b/synapse/module_api/callbacks/spamchecker_callbacks.py index a2f328cafed..9bc572422b8 100644 --- a/synapse/module_api/callbacks/spamchecker_callbacks.py +++ b/synapse/module_api/callbacks/spamchecker_callbacks.py @@ -19,6 +19,7 @@ # # +import functools import inspect import logging from typing import ( @@ -297,6 +298,7 @@ def wrapper( "Bad signature for callback check_registration_for_spam", ) + @functools.wraps(wrapped_func) def run(*args: Any, **kwargs: Any) -> Awaitable: # Assertion required because mypy can't prove we won't change `f` # back to `None`. See