Repository navigation
feat: push messages in Remotes from the API - #665
Merged
xHeaven merged 9 commits intoOct 22, 2026
Merged
Conversation
This was referenced Oct 19, 2026
simonhamp
marked this pull request as ready for review
October 20, 2026 00:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets the mobile app push messages in Remotes, the way the web's composer does. 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.
This one is stacked on #654, because it answers with that PR's
MessageResource. Until #654 merges, the diff here shows its commit too. Only the last commit, "feat: push messages in Remotes from the API", belongs to this PR.Endpoints
Signed, through the web's
messageslimiter (30 a minute).POST /api/v1/remotes/@{username}/messages201with the message indata, the way a thread shows itPOST /api/v1/remotes/orgs/{id}/messagesThe body takes the web's fields:
body, up to 2,000 charactersclient_id, a UUID the app makesreply_to_idlink_preview_url, one of the body's links, or""for no cardSending the same
client_idagain, as a retry does, answers200with the message already created, so it's never stored twice. A first message to someone starts the conversation, which opens for them or lands in Fetched, as on the web.Rules kept from the web
The form requests copy the web's and reuse
CreateConversationMessageRequest::messageRules(), and the actions are the web's own (CreateConversation,CreateMessage).403with the web's own sentence for each case: merge the partner's request first, the user's own request is still waiting, the partner doesn't follow them while requests are off, or the partner has Remotes off.404while the user has Remotes off, for themselves, across a block, and for an org they aren't in.CreateMessage, as on the web.Images
messageRules()already takesimagesandimage_descriptions, but a signed request can't carry files yet. Signed bodies have to be JSON. The commit images PR adds multipart signing toSignedRequestsfor every signed endpoint, so images work here as soon as that lands. Nothing in this PR depends on it.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,300 PHP tests at 100% coverage.