From aff1d6b97f1212d3ddc8f69d79f46127e7f38221 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 20 Nov 2025 12:07:14 +1030 Subject: [PATCH] commando, chanbackup: use custommsg hooks. Signed-off-by: Rusty Russell --- plugins/chanbackup.c | 8 ++++++-- plugins/commando.c | 13 +++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/plugins/chanbackup.c b/plugins/chanbackup.c index 3b0d12860..cebd22013 100644 --- a/plugins/chanbackup.c +++ b/plugins/chanbackup.c @@ -1126,10 +1126,14 @@ static const struct plugin_notification notifs[] = { }, }; +static u64 custommsg_types[] = { WIRE_PEER_STORAGE, WIRE_PEER_STORAGE_RETRIEVAL }; + static const struct plugin_hook hooks[] = { { - "custommsg", - handle_your_peer_storage, + .name = "custommsg", + .handle = handle_your_peer_storage, + .intfilters = custommsg_types, + .num_intfilters = ARRAY_SIZE(custommsg_types), }, { "peer_connected", diff --git a/plugins/commando.c b/plugins/commando.c index f5022be8d..d0d2e91c8 100644 --- a/plugins/commando.c +++ b/plugins/commando.c @@ -603,10 +603,19 @@ static struct command_result *handle_custommsg(struct command *cmd, return command_hook_success(cmd); } +static u64 custommsg_types[] = { + COMMANDO_MSG_CMD_CONTINUES, + COMMANDO_MSG_CMD_TERM, + COMMANDO_MSG_REPLY_CONTINUES, + COMMANDO_MSG_REPLY_TERM, +}; + static const struct plugin_hook hooks[] = { { - "custommsg", - handle_custommsg + .name = "custommsg", + .handle = handle_custommsg, + .intfilters = custommsg_types, + .num_intfilters = ARRAY_SIZE(custommsg_types), }, };