2019-05-02 12:59:16 +02:00
|
|
|
# Server Notices
|
2018-05-23 12:14:23 +02:00
|
|
|
|
|
|
|
'Server Notices' are a new feature introduced in Synapse 0.30. They provide a
|
|
|
|
channel whereby server administrators can send messages to users on the server.
|
|
|
|
|
2021-07-15 13:47:55 +02:00
|
|
|
They are used as part of communication of the server polices (see
|
|
|
|
[Consent Tracking](consent_tracking.md)), however the intention is that
|
2018-05-23 13:34:34 +02:00
|
|
|
they may also find a use for features such as "Message of the day".
|
2018-05-23 12:14:23 +02:00
|
|
|
|
|
|
|
This is a feature specific to Synapse, but it uses standard Matrix
|
|
|
|
communication mechanisms, so should work with any Matrix client.
|
|
|
|
|
2019-05-02 12:59:16 +02:00
|
|
|
## User experience
|
2018-05-23 12:14:23 +02:00
|
|
|
|
|
|
|
When the user is first sent a server notice, they will get an invitation to a
|
|
|
|
room (typically called 'Server Notices', though this is configurable in
|
|
|
|
`homeserver.yaml`). They will be **unable to reject** this invitation -
|
|
|
|
attempts to do so will receive an error.
|
|
|
|
|
|
|
|
Once they accept the invitation, they will see the notice message in the room
|
|
|
|
history; it will appear to have come from the 'server notices user' (see
|
|
|
|
below).
|
|
|
|
|
|
|
|
The user is prevented from sending any messages in this room by the power
|
2018-05-25 12:07:21 +02:00
|
|
|
levels.
|
|
|
|
|
|
|
|
Having joined the room, the user can leave the room if they want. Subsequent
|
|
|
|
server notices will then cause a new room to be created.
|
2018-05-23 12:14:23 +02:00
|
|
|
|
2019-05-02 12:59:16 +02:00
|
|
|
## Synapse configuration
|
2018-05-23 12:14:23 +02:00
|
|
|
|
|
|
|
Server notices come from a specific user id on the server. Server
|
|
|
|
administrators are free to choose the user id - something like `server` is
|
|
|
|
suggested, meaning the notices will come from
|
2018-05-23 16:39:52 +02:00
|
|
|
`@server:<your_server_name>`. Once the Server Notices user is configured, that
|
2018-05-23 12:14:23 +02:00
|
|
|
user id becomes a special, privileged user, so administrators should ensure
|
|
|
|
that **it is not already allocated**.
|
|
|
|
|
|
|
|
In order to support server notices, it is necessary to add some configuration
|
|
|
|
to the `homeserver.yaml` file. In particular, you should add a `server_notices`
|
|
|
|
section, which should look like this:
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
server_notices:
|
|
|
|
system_mxid_localpart: server
|
|
|
|
system_mxid_display_name: "Server Notices"
|
2023-12-12 16:22:19 +01:00
|
|
|
system_mxid_avatar_url: "mxc://example.com/oumMVlgDnLYFaPVkExemNVVZ"
|
2018-05-23 12:14:23 +02:00
|
|
|
room_name: "Server Notices"
|
2023-12-12 16:22:19 +01:00
|
|
|
room_avatar_url: "mxc://example.com/oumMVlgDnLYFaPVkExemNVVZ"
|
|
|
|
room_topic: "Room used by your server admin to notice you of important information"
|
2023-12-04 13:31:42 +01:00
|
|
|
auto_join: true
|
2018-05-23 12:14:23 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
The only compulsory setting is `system_mxid_localpart`, which defines the user
|
2018-05-23 18:43:30 +02:00
|
|
|
id of the Server Notices user, as above. `room_name` defines the name of the
|
2023-12-12 16:22:19 +01:00
|
|
|
room which will be created, `room_avatar_url` its avatar and `room_topic` its topic.
|
2018-05-23 18:43:30 +02:00
|
|
|
|
|
|
|
`system_mxid_display_name` and `system_mxid_avatar_url` can be used to set the
|
|
|
|
displayname and avatar of the Server Notices user.
|
2018-05-23 14:55:39 +02:00
|
|
|
|
2023-12-04 13:31:42 +01:00
|
|
|
`auto_join` will autojoin users to the notices room instead of sending an invite.
|
|
|
|
|
2019-05-02 12:59:16 +02:00
|
|
|
## Sending notices
|
2018-05-23 14:55:39 +02:00
|
|
|
|
2019-05-02 12:59:16 +02:00
|
|
|
To send server notices to users you can use the
|
|
|
|
[admin_api](admin_api/server_notices.md).
|