aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-pseudonym.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-pseudonym.c')
-rw-r--r--src/fs/gnunet-pseudonym.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/fs/gnunet-pseudonym.c b/src/fs/gnunet-pseudonym.c
index 412ddd2b0..247a5a0d8 100644
--- a/src/fs/gnunet-pseudonym.c
+++ b/src/fs/gnunet-pseudonym.c
@@ -106,20 +106,28 @@ ns_printer (void *cls, const char *name, const GNUNET_HashCode * id)
106 106
107static int 107static int
108pseudo_printer (void *cls, const GNUNET_HashCode * pseudonym, 108pseudo_printer (void *cls, const GNUNET_HashCode * pseudonym,
109 const char *name, const char *unique_name,
109 const struct GNUNET_CONTAINER_MetaData *md, int rating) 110 const struct GNUNET_CONTAINER_MetaData *md, int rating)
110{ 111{
111 char *id; 112 char *id, *unique_id;
112 113 int getinfo_result;
113 id = GNUNET_PSEUDONYM_id_to_name (cfg, pseudonym); 114
114 if (id == NULL) 115 /* While we get a name from the caller, it might be NULL.
116 * GNUNET_PSEUDONYM_get_info () never returns NULL.
117 */
118 getinfo_result = GNUNET_PSEUDONYM_get_info (cfg, pseudonym,
119 NULL, NULL, &id, NULL);
120 if (getinfo_result != GNUNET_OK)
115 { 121 {
116 GNUNET_break (0); 122 GNUNET_break (0);
117 return GNUNET_OK; 123 return GNUNET_OK;
118 } 124 }
119 FPRINTF (stdout, "%s (%d):\n", id, rating); 125 unique_id = GNUNET_PSEUDONYM_name_uniquify (cfg, pseudonym, id, NULL);
126 GNUNET_free (id);
127 FPRINTF (stdout, "%s (%d):\n", unique_id, rating);
120 GNUNET_CONTAINER_meta_data_iterate (md, &EXTRACTOR_meta_data_print, stdout); 128 GNUNET_CONTAINER_meta_data_iterate (md, &EXTRACTOR_meta_data_print, stdout);
121 FPRINTF (stdout, "%s", "\n"); 129 FPRINTF (stdout, "%s", "\n");
122 GNUNET_free (id); 130 GNUNET_free (unique_id);
123 return GNUNET_OK; 131 return GNUNET_OK;
124} 132}
125 133
@@ -162,7 +170,8 @@ post_advertising (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg)
162 } 170 }
163 else 171 else
164 { 172 {
165 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Namespace `%s' unknown.\n"), 173 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
174 ("Namespace `%s' unknown. Make sure you specify its numeric suffix, if any.\n"),
166 rating_change); 175 rating_change);
167 } 176 }
168 } 177 }