Skip to content

Push Notifications

mzchat implements push notifications using the UnifiedPush standard, allowing users to choose their own notification provider (distributor).

For the user’s Home Server, the flow is direct:

  1. Assertion: The Client registers a unique distributor endpoint URL with the Home Server.
  2. Delivery: On a new message, the Home Server performs an unauthenticated POST request to the endpoint URL.

Since a client only connects to one server at a time, notifications from Remote Servers must be relayed through the user’s Home Server.

  1. Delegation: During the federated join handshake, the Home Server issues a Push Delegation Token to the Remote Server.
  2. Relay: When a mention occurs on the Remote Server, it calls the PushNotification RPC on the Home Server, providing the delegation token and the encrypted payload.
  3. Final Delivery: The Home Server verifies the token and forwards the notification to the user’s active distributor endpoint.

For platforms without a native distributor (Web, Desktop), users can generate a Custom ntfy Topic.

  • This is effectively a standard ntfy.sh URL (e.g., https://ntfy.sh/mzchat_123).
  • The Client registers this URL just like a UnifiedPush endpoint.
  • Users can subscribe to the same topic on their desktop or mobile ntfy app to bridge notifications.