Skip to content

Support reactions on chat messages - #63

Merged
sionsmith merged 3 commits into
osodevops:mainfrom
aberoham:feat/chat-reactions
Aug 19, 2026
Merged

Support reactions on chat messages#63
sionsmith merged 3 commits into
osodevops:mainfrom
aberoham:feat/chat-reactions

Conversation

@aberoham

Copy link
Copy Markdown
Contributor

Fixes #62.

message react and message unreact accept --chat as an alternative to the --team/--channel pair, posting to the beta /chats/{chatId}/messages/{messageId}/setReaction and unsetReaction endpoints. Clap enforces the alternation, so a mixed or incomplete target is rejected at parse time and still exits 2 before any authentication.

Reaction names Graph does not recognise are translated to their unicode character: eyes to 👀, plus thumbsup, thumbsdown, tada, rocket, fire. The six names in the existing help text are not in the table because Graph accepts them verbatim, so channel behaviour is unchanged. A reaction given as an emoji character passes through untouched.

Tested against a live tenant 👍 — set and removed a reaction on a chat message, confirmed with message list --chat. It reads back as reactionType: "👀", displayName: "Eyes".

README and teams(1) document the chat and emoji forms. cargo fmt, cargo clippy --all-targets -- -D warnings, and cargo test --all-targets pass (137 unit + 56 integration tests).

🤖 Generated with Claude Code

https://claude.ai/code/session_01WaPzFH6fphPwRi2vrNLBuj

aberoham and others added 3 commits August 19, 2026 08:43
`message react` and `message unreact` hard-required `--team` and `--channel`,
so a message in a one-on-one or group chat could not be reacted to at all.
Both commands now accept `--chat` as an alternative, posting to the beta
`/chats/{id}/messages/{id}/setReaction` and `unsetReaction` endpoints, and
reject `--chat` combined with either half of the channel pair.

Graph expects a custom reaction as a unicode character rather than a name, so
a small table translates the names it does not recognise. The six names in the
original help text are deliberately absent from it: the service accepts those
verbatim and translating them would change channel behaviour that already
works. An emoji character supplied directly passes through untouched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WaPzFH6fphPwRi2vrNLBuj
Making `--team` and `--channel` optional let an incomplete invocation parse,
so `react` and `unreact` resolved credentials before noticing the missing
target and exited 3 (auth) instead of 2 (invalid input). Clap now enforces the
alternatives — `--team` requires `--channel` and each is required unless
`--chat` is present — restoring the exit code and rejecting the command before
any authentication happens. An overridden usage line keeps both forms visible
in the error.

README and the man page documented reactions as channel-only, so the chat and
emoji forms existed nowhere but `--help`; both now describe them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WaPzFH6fphPwRi2vrNLBuj
… reactions

Microsoft Graph documents setReaction/unsetReaction on v1.0 for channel and
chat messages and requires the reaction as a unicode character; the legacy
names (like, heart, laugh, surprised, sad, angry) are only returned on reads
and are rejected on writes with HTTP 400 "Unicode 'like' in the payload is
not supported". Verified against a live tenant.

- Reaction endpoints move from beta to v1.0; the beta warning goes away.
- The six classic names are translated to the characters Graph labels
  Like/Heart/Laugh/Surprised/Sad/Angry (👍 ❤️ 😆 😮 🙁 😠), alongside the
  existing aliases. Emoji characters still pass through untouched.
- ChatMessage gains an optional `reactions` field so `message list` and
  `message get` show reactions.
- Wiremock tests cover the POST contract, the 400 for a legacy name, and
  the 403 mapping; the endpoint builders are asserted to target v1.0.
- README, teams(1), command reference, AGENTS.md and CHANGELOG updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sionsmith
sionsmith force-pushed the feat/chat-reactions branch from b17c390 to a035e8e Compare August 19, 2026 07:43
@sionsmith
sionsmith merged commit ea5a6ec into osodevops:main Aug 19, 2026
6 checks passed
@sionsmith sionsmith mentioned this pull request Aug 19, 2026
sionsmith added a commit that referenced this pull request Aug 19, 2026
Bump version to 0.4.0 (Cargo.toml, Cargo.lock) and finalize the CHANGELOG for the reviewed set from #49, #50, #56, #57, #58, #60, #61, #63, #64.
@aberoham
aberoham deleted the feat/chat-reactions branch August 20, 2026 07:09
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.

message react and unreact cannot target chat messages

2 participants