[core] feat(GOWS): implement forwardMessage - #2256
Open
bergpinheiro wants to merge 2 commits into
Open
Conversation
The REST endpoint, the DTO and the MCP tool already existed, and NOWEB, WEBJS and WPP all implement it - GOWS answered 501. Forwarding is not an operation in the protocol: it re-sends the content of an existing message with isForwarded and forwardingScore set on its ContextInfo. GOWS builds that on its side, so the engine only has to say which message to forward; media keys are reused rather than uploaded again. force is set for the same reason NOWEB sets it: your own messages get the marker too, so the recipient sees the same thing whichever engine sent it. A message id that is not in the store answers 422 with the message NOWEB uses, rather than surfacing an engine failure.
…engine refuses Only the message id is used - the chat is resolved separately - so the short form is accepted too, the same way editMessage and sendPollVote already do. Before, a bare id was rejected with an unhandled error and surfaced as a 500. A refusal from the engine is an answer, not a fault: a poll, a type with nowhere to carry the forwarded markers, or a session with message storage turned off now come back as 422 with the reason, instead of a 500.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
POST /api/forwardMessage already had the REST endpoint, the DTO and the MCP
tool, and NOWEB, WEBJS and WPP all implement it. GOWS answered 501.
GOWS builds the forwarded message on its side, so the engine only says which
message to forward.
forceis set for the same reason NOWEB sets it: your ownmessages get the marker too, so the recipient sees the same thing whichever
engine sent it.
Only the message id is used - the chat is resolved separately - so the short
form is accepted as well, the same way editMessage and sendPollVote already do.
A refusal from the engine is an answer, not a fault: a missing message, a poll,
a type with nowhere to carry the forwarded markers, or a session with message
storage turned off all come back as 422 with the reason, matching what the
other engines answer.
Validated against a live session on every message type, including a forward of
an already-forwarded message.
Depends on the forward option in gows-plus. This compiles and passes CI as it
is - the generated stubs are in the diff - but needs a gows release carrying
the new field to actually run.
Issue #1439