summary refs log tree commit diff
path: root/docs/modules/porting_legacy_module.md
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2021-09-08 19:14:54 +0200
committerGitHub <noreply@github.com>2021-09-08 17:14:54 +0000
commit03caba65777ab6ec8d089f8975352242e0d7b0af (patch)
treea88495bb8c0f11d55c56ab3c5075673a69e9cf48 /docs/modules/porting_legacy_module.md
parentFix frontend_proxy jinja script in docker workers (#10783) (diff)
downloadsynapse-03caba65777ab6ec8d089f8975352242e0d7b0af.tar.xz
Improve the modules doc (#10758)
* Split up the documentation in several files rather than one huge one
* Add examples for each callback category
* Other niceties like fixing https://github.com/matrix-org/synapse/issues/10632
* Add titles to callbacks so they're easier to find in the navigation panels and link to
Diffstat (limited to 'docs/modules/porting_legacy_module.md')
-rw-r--r--docs/modules/porting_legacy_module.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/modules/porting_legacy_module.md b/docs/modules/porting_legacy_module.md
new file mode 100644

index 0000000000..a7a251e535 --- /dev/null +++ b/docs/modules/porting_legacy_module.md
@@ -0,0 +1,17 @@ +# Porting an existing module that uses the old interface + +In order to port a module that uses Synapse's old module interface, its author needs to: + +* ensure the module's callbacks are all asynchronous. +* register their callbacks using one or more of the `register_[...]_callbacks` methods + from the `ModuleApi` class in the module's `__init__` method (see [this section](writing_a_module.html#registering-a-callback) + for more info). + +Additionally, if the module is packaged with an additional web resource, the module +should register this resource in its `__init__` method using the `register_web_resource` +method from the `ModuleApi` class (see [this section](writing_a_module.html#registering-a-web-resource) for +more info). + +The module's author should also update any example in the module's configuration to only +use the new `modules` section in Synapse's configuration file (see [this section](index.html#using-modules) +for more info).