Johannes Marbach
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # MSC0000: Remotely toggling (push) notifications for another client The [push notification API](https://spec.matrix.org/v1.3/client-server-api/#push-notifications) allows clients to register HTTP pushers so that they can receive notifications. An HTTP pusher is always tied to a specific Matrix device due to its `pushkey` property which is issued by the particular platform (e.g. an APNS token). As a client is aware of its `pushkey`s, it can identify its own pushers and remove or read them as needed. There is, however, no way to modify a client's pushers from another client logged into the same account because the latter isn't aware of the former's `pushkey`s. A similar situation exists when a client fakes notifications locally from `/sync` responses without relying on a pusher. Other clients of the same user have no way of knowing whether the client triggers notifications nor can they modify its behavior. This is limiting because it means that in both cases push notifications can only be en- or disabled on the device that is receiving them. When the latter isn't currently at hand, this can become a point of frustration. The current proposal solves this problem by making the connection between HTTP pushers and Matrix devices explicit and assigning an enabled state to every pusher. Additionally, for pusher-less clients the enabled state is mediated through account data events. ## Proposal ### Pusher-dependent clients #### Disabling pushers A new nullable field `is_disabled` is added to the `Pusher` model. In [POST /_matrix/client/v3/pushers/set](https://spec.matrix.org/v1.3/client-server-api/#post_matrixclientv3pushersset) the value is optional and if omitted, defaults to `false`. In [GET /_matrix/client/v3/pushers](https://spec.matrix.org/v1.3/client-server-api/#get_matrixclientv3pushers) the value is always returned. Pushers that are disabled do not send [`/notify`](https://spec.matrix.org/v1.3/push-gateway-api/#post_matrixpushv1notify) requests to push providers, or produce email notifications. #### Explicitly linking device and pusher A new field `device_id` is added to the `Pusher` model. To be able to remove Pushers when sessions are deleted home servers must have some existing way to link a session to pusher, so exposing the `device_id` on http pushers should be trivial. (Synapse, for instance, stores the [access token](https://github.com/matrix-org/synapse/blob/develop/synapse/storage/databases/main/pusher.py#L487) when adding a pusher) In [GET /_matrix/client/v3/pushers](https://spec.matrix.org/v1.3/client-server-api/#get_matrixclientv3pushers) the value is required when `kind` is `http`. If `kind` is _not_ `http`, the `device_id` field is null. In [POST /_matrix/client/v3/pushers/set](https://spec.matrix.org/v1.3/client-server-api/#post_matrixclientv3pushersset) `device_id` is an invalid parameter and should raise an invalid request error. ### Pusher-less clients A new account data event of type `m.notification_settings.<device-id>` and content ``` { is_paused: boolean } ``` is introduced. Clients that simulate push notifications locally without relying on a pusher (such as Element Web and other web or desktop clients) take the event into account when computing notifications. While no pause-push-notifications event exists for the current device, or a pause-push-notifications event exists where isPaused is falsy, events should be processed as normal and trigger push notifs where necessary. While a pause-push-notifications event exists for the current device where isPaused is true, no event should trigger a push notification (sound, banner, lock screen). Clients that obey io.element.pause-push-notifications.<device-id> during client side notification filtering should ensure a pause-push-notifications event exists for the active device to indicate silencing push is supported for that device. UI design should communicate that silencing push notifications is only available for some clients. When a device is removed these events will be pruned. (Existing pruning logic for DM client-info events will be reusable) As web notifications are produced by /sync anyway, account data will be up to date at the point of event processing for notifications. ## Migration Clients that connect to a home server that doesn't yet support this proposal should interpret a missing `is_disabled` value as `false`. Home servers should migrate pushers that were registered before this proposal so that `is_disabled` is `false` ## Potential issues Adding an enabled state to pushers increases the complexity of the push notification API. In addition to a pusher existing or not existing, implementations now have to also evaluate the pusher's `is_disabled` field. ## Alternatives The spec allows for pushers to be assigned a [`profile_tag`](https://spec.matrix.org/v1.3/client-server-api/#post_matrixclientv3pushersset) which can be used to define per-device push rule sets. In combination with the `notify_in_app` action proposed in [MSC3768](https://github.com/matrix-org/matrix-spec-proposals/pull/3768) this would allow to toggle a pusher between the `global` push rule set and a push rule set where all rules with `notify` actions were overridden to use `notify_in_app`. Furthermore, the overrides could be simplified through cascading profile tags as proposed in [MSC3837](https://github.com/matrix-org/matrix-spec-proposals/pull/3837). Keeping the two sets in sync would, however, not be trivial. Additionally, profile tags are only partially spec'ed and there is active interest in [removing](https://github.com/matrix-org/matrix-spec/issues/637) them entirely. Another alternative is client-side notification filtering at the time of delivery which is supported on many platforms. This feature could be (ab)used to create the _impression_ of paused push notifications. The downside, however, is that this is not a true deactivation and the wasteful overhead of sending and processing push notifications still exists. Finally, when registering a pusher, a client could store the request body for [/_matrix/client/v3/pushers/set](https://spec.matrix.org/v1.3/client-server-api/#post_matrixclientv3pushersset) in a per-device account data event. Other clients of the same user could then issue network request on the client's behalf using the body of said event. This appears somewhat kludgey though and would also conflict with existing home server logic to store access tokens when adding or modifying pushers. ## Security considerations None. ## Unstable prefix Until this proposal lands - `is_disabled` should be referred to as `org.matrix.msc0000.is_disabled` - `device_id` should be referred to as `org.matrix.msc0000.device_id` - `m.notification_settings.<device-id>` should be referred to as `org.matrix.msc0000.notification_settings.<device-id>` ## Dependencies None.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully