diff options
author | Bertrand Marc <beberking@gmail.com> | 2012-06-06 20:47:48 +0200 |
---|---|---|
committer | Bertrand Marc <beberking@gmail.com> | 2012-06-06 20:47:48 +0200 |
commit | 740b30688bd745a527f96f9116c19acb3480971a (patch) | |
tree | 2709a3f4dba11c174aa9e1ba3612e30c578e76a9 /src/fs/gnunet-pseudonym.c | |
parent | 2b81464a43485fcc8ce079fafdee7b7a171835f4 (diff) |
Imported Upstream version 0.9.3upstream/0.9.3
Diffstat (limited to 'src/fs/gnunet-pseudonym.c')
-rw-r--r-- | src/fs/gnunet-pseudonym.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/fs/gnunet-pseudonym.c b/src/fs/gnunet-pseudonym.c index 412ddd2..38826d1 100644 --- a/src/fs/gnunet-pseudonym.c +++ b/src/fs/gnunet-pseudonym.c @@ -106,20 +106,29 @@ ns_printer (void *cls, const char *name, const GNUNET_HashCode * id) static int pseudo_printer (void *cls, const GNUNET_HashCode * pseudonym, + const char *name, const char *unique_name, const struct GNUNET_CONTAINER_MetaData *md, int rating) { char *id; - - id = GNUNET_PSEUDONYM_id_to_name (cfg, pseudonym); - if (id == NULL) + char *unique_id; + int getinfo_result; + + /* While we get a name from the caller, it might be NULL. + * GNUNET_PSEUDONYM_get_info () never returns NULL. + */ + getinfo_result = GNUNET_PSEUDONYM_get_info (cfg, pseudonym, + NULL, NULL, &id, NULL); + if (getinfo_result != GNUNET_OK) { GNUNET_break (0); return GNUNET_OK; } - FPRINTF (stdout, "%s (%d):\n", id, rating); + unique_id = GNUNET_PSEUDONYM_name_uniquify (cfg, pseudonym, id, NULL); + GNUNET_free (id); + FPRINTF (stdout, "%s (%d):\n", unique_id, rating); GNUNET_CONTAINER_meta_data_iterate (md, &EXTRACTOR_meta_data_print, stdout); FPRINTF (stdout, "%s", "\n"); - GNUNET_free (id); + GNUNET_free (unique_id); return GNUNET_OK; } @@ -162,7 +171,8 @@ post_advertising (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) } else { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Namespace `%s' unknown.\n"), + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + ("Namespace `%s' unknown. Make sure you specify its numeric suffix, if any.\n"), rating_change); } } |