Skip to content

Add chat_channel_invite() - #26

Merged
TroyHernandez merged 2 commits into
mainfrom
channel-invite
Oct 21, 2026
Merged

TroyHernandez merged 2 commits into
mainfrom
channel-invite

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

chat_channel_invite(client, channel, user) invites a user to a channel: the other side of the invitations chat_poll() reports.

A consumer that files rooms under a space falls back to a direct invite when the restricted join rules cannot be written (room version < 9), and the contract had no verb for that, so it was dropping down to mx.api directly.

  • Generic plus a default method that errors with the capability to check, like the other gated verbs.
  • Matrix: mx.api::mx_room_invite(), with an .invite testing seam on chat_matrix(). Errors propagate, as for join and leave.
  • Loopback: records the invitation in client$env$invites; the record is what a consumer's test asserts on.
  • chat_capabilities()$channel_invite: TRUE for Matrix and loopback, FALSE for Slack, Telegram and IRC. The every-adapter capability test covers the new flag.
  • Tests for the generic, the loopback record, and the Matrix seam (arguments in mx_room_invite()'s order; a refused invitation propagates).

Version 0.1.0.2.

Invites a user to a channel: the other side of the invitations
chat_poll() reports. Matrix implements it over mx.api::mx_room_invite()
with an .invite testing seam; the loopback adapter records the
invitation, which is what a consumer's test asserts on; Slack, Telegram
and IRC report channel_invite = FALSE and the default method errors
with the capability to check, like the other gated verbs.

A consumer filing rooms under a space falls back to a direct invite
when restricted join rules cannot be written, and the contract had no
verb for that.
@TroyHernandez
TroyHernandez merged commit 6d005f6 into main Oct 21, 2026
2 checks passed
@TroyHernandez
TroyHernandez deleted the channel-invite branch October 21, 2026 21:19
TroyHernandez added a commit to cornball-ai/drat that referenced this pull request Oct 21, 2026
Built from main after cornball-ai/chat.api#26 (chat_channel_invite()).
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.

1 participant