Skip to content

Conversation

@adamvy
Copy link
Member

@adamvy adamvy commented Jan 16, 2026

Summary

  • Adds a new management-room command: kick-me.
  • When run inside a portal room, emits a remote chat info change that sets the current user’s membership to leave.
  • Intended for testing clients’ "kicked but room still exists" behavior (no chat deletion).

Testing

  • Manual: run kick-me in a dummybridge portal and verify the client receives a self leave membership event.

@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added a "kick-me" command allowing logged-in users to remove themselves from a chat or portal. Only available when inside an active portal session; processes the membership departure and returns a confirmation message (optionally with a reason).

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Adds a new authenticated command, KickMeCommand (kick-me), to the connector. When run inside a portal it builds a simulated membership-leave event for the invoking user, queues that remote event via the bridge, and sends a confirmation reply. The command is registered in AllCommands.

Changes

Cohort / File(s) Summary
Command Addition
pkg/connector/commands.go
Added imports (ptr, networkid, simplevent) and a new exported KickMeCommand (kick-me) requiring login. The handler constructs remote event metadata, creates a simulated membership-leave event for the initiator, queues the event via the bridge's remote event queue, and replies with an optional reason. Registered KickMeCommand in AllCommands.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Connector
  participant Bridge
  participant RemoteQueue

  User->>Connector: invoke "kick-me" (optional reason) inside portal
  Connector->>Connector: validate portal & login
  Connector->>Bridge: Build simulated membership-leave event (with metadata)
  Bridge->>RemoteQueue: Queue remote membership-leave event
  RemoteQueue-->>Bridge: ack queued
  Bridge-->>Connector: ack
  Connector-->>User: send confirmation reply (optional reason)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a kick-me command that simulates a user leaving a portal room.
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose, behavior, and testing approach for the new kick-me command.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/kick-me-command

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ca19eea02

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@adamvy
Copy link
Member Author

adamvy commented Jan 16, 2026

Updated per review:

  • Emits membership When do you have to leave? with and includes .
  • Uses the bridge bot as the Matrix sender (so it looks like a kick, not a voluntary leave).
  • Supports optional , sending the reason via as .

Commit: 4132e9f

@adamvy
Copy link
Member Author

adamvy commented Jan 16, 2026

Updated kick-me per review:

  • Emits membership leave with IsFromMe=false and includes SenderLogin.
  • Uses the bridge bot as the Matrix sender (so it looks like a kick, not a voluntary leave).
  • Supports optional kick-me [reason...], sending the reason via MemberEventExtra as reason.

Commit: 4132e9f

@adamvy adamvy requested a review from tulir January 16, 2026 22:13
@adamvy adamvy merged commit 44ab1c4 into main Jan 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants