commit f43c9b7406ef68098a01d5fdfd4cb7a8932fdf09
parent 0a2703abb10717ca86902aeb172224d8e8dc8768
Author: Jacki <jacki@thejackimonster.de>
Date: Mon, 13 Jan 2025 21:32:53 +0100
Implement flag to simplify merge messages for visualization purposes
Signed-off-by: Jacki <jacki@thejackimonster.de>
Diffstat:
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/tools/gnunet_messenger_uml.c b/tools/gnunet_messenger_uml.c
@@ -64,6 +64,7 @@ struct GNUNET_MESSENGER_Tool
char *room_name;
int ignore_targets;
int ignore_epochs;
+ int simplify_merges;
bool quit;
};
@@ -160,6 +161,13 @@ message_callback (void *cls,
tool->task = NULL;
}
+ if ((tool->simplify_merges) &&
+ (GNUNET_MESSENGER_KIND_MERGE == message->header.kind))
+ {
+ printf("<> X%s\n", GNUNET_h2s(hash));
+ goto print_links;
+ }
+
printf(
"json X%s {",
GNUNET_h2s(hash)
@@ -304,6 +312,7 @@ message_callback (void *cls,
printf("\n}\n");
+print_links:
if (GNUNET_MESSENGER_KIND_MERGE == message->header.kind)
{
add_link(tool, hash, &(message->body.merge.previous), GNUNET_MESSENGER_LINK_DEFAULT);
@@ -485,6 +494,12 @@ main (int argc,
"ignore indirect connections between epoch messages and their previous epoch",
&(tool.ignore_epochs)
),
+ GNUNET_GETOPT_option_flag(
+ 'm',
+ "simplify-merges",
+ "simplify merge messages in the message graph",
+ &(tool.simplify_merges)
+ ),
GNUNET_GETOPT_OPTION_END
};