Telegram: attribute forwarded messages #25
Labels
No labels
in-review
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
weiwen/evie#25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
Let evie recognize forwarded Telegram messages and mark them as such, so pi knows the content originated elsewhere. Today a forward is treated as an ordinary message with no signal that it was forwarded.
When a message has forward metadata (
forward_origin), evie prepends a compact attribution line and passes the content verbatim:[Forwarded from <origin>, <date>]when the origin is available (user, hidden user, chat, or channel — whateverMessageOriginexposes).[Forwarded]when the origin is hidden/unavailable.The attribution is orthogonal to content type: it composes with the existing text and photo handlers, and with the document (#24) and location (#23) branches when those are present — a forwarded document gets both the prefix and the document handling, a forwarded pin gets the prefix and the location marker. This slice carries the small restructure that computes the forward prefix once and prepends it to whichever content branch runs.
Acceptance criteria
[Forwarded from <origin>, <date>]before the content and produces a normal streamed reply[Forwarded]marker is usedBlocked by
None - can start immediately (composes cleanest atop #24 if that merges first, but is not gated on it)
Implemented in branch
sandcastle/issue-25(commit87513d3).What was done:
format_forward_prefix(origin: &MessageOrigin) -> String— maps all fourMessageOriginvariants (User, HiddenUser, Chat, Channel) to[Forwarded from <name>, YYYY-MM-DD]; falls back to[Forwarded]when no name is available.apply_forward_prefix(extraction, prefix) -> Extraction— pure helper that prepends the prefix toExtraction::Content.text, leavingFileTooLargeandUnhandleduntouched.extract_message_contentinto raw extraction + apply-prefix, so text, photo, and document branches all get attribution automatically.No Rust toolchain in sandbox — CI will validate compilation and tests.