| 1076 | } |
| 1077 | |
| 1078 | static void plugin_notify_cb(const char *buffer, |
| 1079 | const jsmntok_t *methodtok, |
| 1080 | const jsmntok_t *paramtoks, |
| 1081 | const jsmntok_t *idtok, |
| 1082 | struct plugin_rpccall *call) |
| 1083 | { |
| 1084 | struct command *cmd = call->cmd; |
| 1085 | struct json_stream *response; |
| 1086 | |
| 1087 | if (!cmd->jcon || !cmd->send_notifications) |
| 1088 | return; |
| 1089 | |
| 1090 | response = json_stream_raw_for_cmd(cmd); |
| 1091 | json_object_start(response, NULL); |
| 1092 | json_add_string(response, "jsonrpc", "2.0"); |
| 1093 | json_add_tok(response, "method", methodtok, buffer); |
| 1094 | json_stream_append(response, ",\"params\":", strlen(",\"params\":")); |
| 1095 | json_stream_forward_change_id(response, buffer, |
| 1096 | paramtoks, idtok, cmd->id, |
| 1097 | cmd->id_is_string); |
| 1098 | json_object_end(response); |
| 1099 | |
| 1100 | json_stream_double_cr(response); |
| 1101 | json_stream_flush(response); |
| 1102 | } |
| 1103 | |
| 1104 | struct plugin *find_plugin_for_command(struct lightningd *ld, |
| 1105 | const char *cmd_name) |
nothing calls this directly
no test coverage detected