mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-08-30 06:26:33 +00:00
fixed bug in json-rpc webhook
* only post messages that were received via 'receive' see #813
This commit is contained in:
parent
eeacb488ad
commit
07260c0811
@ -233,13 +233,6 @@ func (r *JsonRpc2Client) ReceiveData(number string, receiveWebhookUrl string) {
|
||||
}
|
||||
log.Debug("json-rpc received data: ", str)
|
||||
|
||||
if receiveWebhookUrl != "" {
|
||||
err = postMessageToWebhook(receiveWebhookUrl, []byte(str))
|
||||
if err != nil {
|
||||
log.Error("Couldn't post data to webhook: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
var resp1 JsonRpc2ReceivedMessage
|
||||
json.Unmarshal([]byte(str), &resp1)
|
||||
if resp1.Method == "receive" {
|
||||
@ -254,6 +247,13 @@ func (r *JsonRpc2Client) ReceiveData(number string, receiveWebhookUrl string) {
|
||||
continue
|
||||
}
|
||||
r.receivedMessagesMutex.Unlock()
|
||||
|
||||
if receiveWebhookUrl != "" {
|
||||
err = postMessageToWebhook(receiveWebhookUrl, []byte(str))
|
||||
if err != nil {
|
||||
log.Error("Couldn't post data to webhook: ", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var resp2 JsonRpc2MessageResponse
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user