aboutsummaryrefslogtreecommitdiff
path: root/src/cli/messenger/gnunet-messenger.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/messenger/gnunet-messenger.c')
-rw-r--r--src/cli/messenger/gnunet-messenger.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cli/messenger/gnunet-messenger.c b/src/cli/messenger/gnunet-messenger.c
index 6258ce712..e3c10d509 100644
--- a/src/cli/messenger/gnunet-messenger.c
+++ b/src/cli/messenger/gnunet-messenger.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2020--2023 GNUnet e.V. 3 Copyright (C) 2020--2024 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published 6 under the terms of the GNU Affero General Public License as published
@@ -46,21 +46,26 @@ void
46on_message (void *cls, 46on_message (void *cls,
47 struct GNUNET_MESSENGER_Room *room, 47 struct GNUNET_MESSENGER_Room *room,
48 const struct GNUNET_MESSENGER_Contact *sender, 48 const struct GNUNET_MESSENGER_Contact *sender,
49 const struct GNUNET_MESSENGER_Contact *recipient,
49 const struct GNUNET_MESSENGER_Message *message, 50 const struct GNUNET_MESSENGER_Message *message,
50 const struct GNUNET_HashCode *hash, 51 const struct GNUNET_HashCode *hash,
51 enum GNUNET_MESSENGER_MessageFlags flags) 52 enum GNUNET_MESSENGER_MessageFlags flags)
52{ 53{
53 const char *sender_name = GNUNET_MESSENGER_contact_get_name (sender); 54 const char *sender_name = GNUNET_MESSENGER_contact_get_name (sender);
55 const char *recipient_name = GNUNET_MESSENGER_contact_get_name (recipient);
54 56
55 if (! sender_name) 57 if (! sender_name)
56 sender_name = "anonymous"; 58 sender_name = "anonymous";
57 59
60 if (! recipient_name)
61 recipient_name = "anonymous";
62
58 printf ("[%s ->", GNUNET_h2s (&(message->header.previous))); 63 printf ("[%s ->", GNUNET_h2s (&(message->header.previous)));
59 printf (" %s]", GNUNET_h2s (hash)); 64 printf (" %s]", GNUNET_h2s (hash));
60 printf ("[%s] ", GNUNET_sh2s (&(message->header.sender_id))); 65 printf ("[%s] ", GNUNET_sh2s (&(message->header.sender_id)));
61 66
62 if (flags & GNUNET_MESSENGER_FLAG_PRIVATE) 67 if (flags & GNUNET_MESSENGER_FLAG_PRIVATE)
63 printf ("*"); 68 printf ("*( '%s' ) ", recipient_name);
64 69
65 switch (message->header.kind) 70 switch (message->header.kind)
66 { 71 {