mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Adapt receive subscription notification to have payload in result field
This commit is contained in:
parent
6cbd583746
commit
b51c791629
2 changed files with 9 additions and 4 deletions
|
@ -3,6 +3,11 @@
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
**Attention**: Now requires native libsignal-client version 0.30.0
|
**Attention**: Now requires native libsignal-client version 0.30.0
|
||||||
|
|
||||||
|
### Breaking changes
|
||||||
|
- Adapt receive subscription notification in JSON-RPC to have payload in result field
|
||||||
|
- Before: `{"jsonrpc":"2.0","method":"receive","params":{"envelope":{ ... },"account":"+XXX","subscription":0}}`
|
||||||
|
- After: `{"jsonrpc":"2.0","method":"receive","params":{"subscription":0,"result":{"envelope":{ ... },"account":"+XXX"}}}`
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Manage identities via DBus (Thanks @bublath)
|
- Manage identities via DBus (Thanks @bublath)
|
||||||
- Added support for SVR2 PINs
|
- Added support for SVR2 PINs
|
||||||
|
|
|
@ -4,7 +4,6 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.node.ArrayNode;
|
import com.fasterxml.jackson.databind.node.ArrayNode;
|
||||||
import com.fasterxml.jackson.databind.node.ContainerNode;
|
|
||||||
import com.fasterxml.jackson.databind.node.IntNode;
|
import com.fasterxml.jackson.databind.node.IntNode;
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
|
|
||||||
|
@ -86,8 +85,9 @@ public class SignalJsonRpcDispatcherHandler {
|
||||||
final var subscriptionId = nextSubscriptionId.getAndIncrement();
|
final var subscriptionId = nextSubscriptionId.getAndIncrement();
|
||||||
final var handlers = managers.stream().map(m -> {
|
final var handlers = managers.stream().map(m -> {
|
||||||
final var receiveMessageHandler = new JsonReceiveMessageHandler(m, s -> {
|
final var receiveMessageHandler = new JsonReceiveMessageHandler(m, s -> {
|
||||||
final ContainerNode<?> params = objectMapper.valueToTree(s);
|
final var params = new ObjectNode(objectMapper.getNodeFactory());
|
||||||
((ObjectNode) params).set("subscription", IntNode.valueOf(subscriptionId));
|
params.set("subscription", IntNode.valueOf(subscriptionId));
|
||||||
|
params.set("result", objectMapper.valueToTree(s));
|
||||||
final var jsonRpcRequest = JsonRpcRequest.forNotification("receive", params, null);
|
final var jsonRpcRequest = JsonRpcRequest.forNotification("receive", params, null);
|
||||||
try {
|
try {
|
||||||
jsonRpcSender.sendRequest(jsonRpcRequest);
|
jsonRpcSender.sendRequest(jsonRpcRequest);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue