Skip to content

feat: react to messages in Remotes from the API - #656

Merged
xHeaven merged 3 commits into
dev-null-sh:productionfrom
simonhamp:feat/api-remotes-reactions
Oct 22, 2026
Merged

xHeaven merged 3 commits into
dev-null-sh:productionfrom
simonhamp:feat/api-remotes-reactions

Conversation

@simonhamp

Copy link
Copy Markdown
Contributor

Lets the mobile app react to messages in Remotes, the way the web's reaction tray and chips do. It's one of a few small PRs that bring Remotes to the app (NativePHP/dev-null-app) on top of the signed API from #130. It stands alone: it only needs a message id, which the conversations PR (#654) hands out.

Endpoints

All signed. They go through the web's conversations limiter (300 a minute).

Request Answer
GET /api/v1/remotes/reactions {"usage": [{"emoji", "count"}]}, the user's emoji, most used first
POST /api/v1/remotes/messages/{id}/reactions with emoji {"reactions": [{"user_id", "emoji"}]}, in the order they were left
DELETE /api/v1/remotes/messages/{id}/reactions with emoji The same

Rules kept from the web

The form requests are copies of the web's, and the actions and ReactionUsageQuery are the web's own.

  • Only emoji from the shortcode set are taken.
  • Each person can leave up to 12 different emoji on a message.
  • Reacting twice leaves one reaction, and taking back one that isn't there is fine.
  • Org events can't be reacted to, and neither can a message outside the history an org member can see (404).
  • A conversation waiting on a request can't be reacted to until it's merged. That's a 403 with the web's message.
  • Everything is a 404 while the user has Remotes off, or across a block.

Reacting bumps the conversation's reactions_version, as on the web, so the other person's poll picks the change up.

Testing

Everything CI runs passes on this branch locally: Pint, Rector, the JS lint, PHPStan, tsc, type coverage, the JS unit tests, and all 3,242 PHP tests at 100% coverage.

@simonhamp
simonhamp marked this pull request as ready for review October 19, 2026 23:45
@xHeaven
xHeaven merged commit ccc1982 into dev-null-sh:production Oct 22, 2026
5 checks passed
@simonhamp
simonhamp deleted the feat/api-remotes-reactions branch October 22, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants