signal-bot/signal_bot
Krzysztof kuhy Rudnicki a202317072 feat: answer the message that asked, not just the room
A "!cat" in a busy group produced a cat picture floating loose in the chat with
nothing tying it to whoever asked. Replies now quote the triggering message.

The container advertises this and always could: /v1/about reports
capabilities {"v2/send": ["quotes", "mentions"]}, and /v2/send takes
quote_timestamp, quote_author and quote_message. What was missing was on this
side -- parse_envelope discarded the envelope's timestamp, which is the id
Signal quotes a message by, so nothing downstream could have built a quote even
in principle. IncomingMessage now carries it, preferring the payload's own
value over the envelope's for the case where they ever disagree.

Quote is a value object rather than three more parameters threaded through
every send: the Transport protocol has five methods and two of them send.
CommandContext grows reply_image() so quoting lives in one place instead of
each handler reaching for ctx.transport itself, which is what animals.py did.

quote_of() returns None when the timestamp or author is missing. Answering the
room is a worse reply than a quoted one but a much better outcome than a
payload the container rejects.

The e2e gate learned to tell the two apart: Expectation.quotes demands a send
either does or does not point at a message, defaulting to None so the ten
existing scenarios stay indifferent. Without it the fake would have accepted an
unquoted reply as a pass.

Verified in the testbot group on a real Signal client before this bump, per
kuhy's rule that a bump is a publish rather than a checkpoint: he sent !cat and
confirmed the picture renders attached to his message as a reply.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015d48t4qsQLBJnDwDeo2Nom
2026-08-29 23:01:01 +02:00
..
__init__.py feat: rewrite the bot so it runs, and gate it like the other repos 2026-08-29 13:05:42 +02:00
__main__.py feat: make the bot actually reply on Signal, and gate every way it went silent 2026-08-29 14:37:27 +02:00
aliases.json feat: rewrite the bot so it runs, and gate it like the other repos 2026-08-29 13:05:42 +02:00
animals.py feat: answer the message that asked, not just the room 2026-08-29 23:01:01 +02:00
announce.py feat: name every release after a pope, and tell the group when one lands 2026-08-29 22:51:20 +02:00
app.py feat: name every release after a pope, and tell the group when one lands 2026-08-29 22:51:20 +02:00
changelog.py feat: answer the message that asked, not just the room 2026-08-29 23:01:01 +02:00
config.py feat: refuse to look healthy while deaf, and heal the container by itself 2026-08-29 19:01:55 +02:00
counting.py feat: discover groups from the account, so adding the bot is the whole setup 2026-08-29 15:30:08 +02:00
decorators.py chore: drop the last references to a command this repo no longer has 2026-08-29 22:32:12 +02:00
discovery.py fix: never let the trust gate un-watch a group it already adopted 2026-08-29 19:04:39 +02:00
dispatcher.py feat: refuse to look healthy while deaf, and heal the container by itself 2026-08-29 19:01:55 +02:00
groups.py feat: discover groups from the account, so adding the bot is the whole setup 2026-08-29 15:30:08 +02:00
http_client.py feat: rewrite the bot so it runs, and gate it like the other repos 2026-08-29 13:05:42 +02:00
liveness.py feat: refuse to look healthy while deaf, and heal the container by itself 2026-08-29 19:01:55 +02:00
membership.py feat: refuse to look healthy while deaf, and heal the container by itself 2026-08-29 19:01:55 +02:00
models.py feat: answer the message that asked, not just the room 2026-08-29 23:01:01 +02:00
popes.json feat: name every release after a pope, and tell the group when one lands 2026-08-29 22:51:20 +02:00
portcheck.py feat: make the bot actually reply on Signal, and gate every way it went silent 2026-08-29 14:37:27 +02:00
quoting.py feat: answer the message that asked, not just the room 2026-08-29 23:01:01 +02:00
registry.py feat: answer the message that asked, not just the room 2026-08-29 23:01:01 +02:00
scheduler.py feat: rewrite the bot so it runs, and gate it like the other repos 2026-08-29 13:05:42 +02:00
schema.py feat: name every release after a pope, and tell the group when one lands 2026-08-29 22:51:20 +02:00
store.py feat: name every release after a pope, and tell the group when one lands 2026-08-29 22:51:20 +02:00
transport_base.py feat: answer the message that asked, not just the room 2026-08-29 23:01:01 +02:00
transport_fake.py feat: answer the message that asked, not just the room 2026-08-29 23:01:01 +02:00
transport_rest.py feat: answer the message that asked, not just the room 2026-08-29 23:01:01 +02:00
trust.py feat: refuse to look healthy while deaf, and heal the container by itself 2026-08-29 19:01:55 +02:00
versioning.py feat: answer the message that asked, not just the room 2026-08-29 23:01:01 +02:00