From 955f78f0839a05b0af07c053a93732f353547d10 Mon Sep 17 00:00:00 2001 From: Mykola Balakin Date: Tue, 13 Oct 2026 23:01:54 +0300 Subject: [PATCH] Parse the payload as manual only in manual mode --- src/client/jsonrpc2.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/client/jsonrpc2.go b/src/client/jsonrpc2.go index 69935eb..15afadf 100644 --- a/src/client/jsonrpc2.go +++ b/src/client/jsonrpc2.go @@ -259,12 +259,14 @@ func (r *JsonRpc2Client) ReceiveData(number string, receiveWebhookUrl string) { // the envelope directly. Unwrap so the broadcast format is // the same in both modes and downstream consumers (e.g. the // websocket handler) don't have to know which mode is in use. - var manualWrapper struct { - Subscription int64 `json:"subscription"` - Result json.RawMessage `json:"result"` - } - if err := json.Unmarshal(resp1.Params, &manualWrapper); err == nil && len(manualWrapper.Result) > 0 { - resp1.Params = manualWrapper.Result + if r.manualReceiveMode { + var manualWrapper struct { + Subscription int64 `json:"subscription"` + Result json.RawMessage `json:"result"` + } + if err := json.Unmarshal(resp1.Params, &manualWrapper); err == nil && len(manualWrapper.Result) > 0 { + resp1.Params = manualWrapper.Result + } } r.receivedMessagesMutex.Lock()