fix
[oweals/gnunet.git] / src / fs / gnunet-pseudonym.c
index e7b2bb8ddb1a6932aebf5c5eb97f2894f827440a..9f85f05457331d74f1861805c73e70ac19c7a108 100644 (file)
@@ -251,7 +251,6 @@ run (void *cls,
      const char *cfgfile,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
-  struct GNUNET_FS_Uri *ns_uri;
   struct GNUNET_TIME_Absolute expiration;
   char *emsg;
 
@@ -261,7 +260,8 @@ run (void *cls,
                       "gnunet-pseudonym",
                       &progress_cb,
                       NULL,
-                      GNUNET_FS_FLAGS_NONE);
+                      GNUNET_FS_FLAGS_NONE,
+                      GNUNET_FS_OPTIONS_END);
   if (NULL != delete_ns)
     {
       ns = GNUNET_FS_namespace_create (h, delete_ns);
@@ -289,9 +289,6 @@ run (void *cls,
        {
          if (NULL != root_identifier)
            {
-             emsg = NULL;
-             ns_uri = GNUNET_FS_uri_sks_create (ns, root_identifier, &emsg);
-             GNUNET_assert (emsg == NULL);
              expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_YEARS);
              if (ksk_uri == NULL)
                {
@@ -299,21 +296,33 @@ run (void *cls,
                  ksk_uri = GNUNET_FS_uri_parse ("gnunet://fs/ksk/namespace", &emsg);
                  GNUNET_assert (NULL == emsg);
                }
-             GNUNET_FS_publish_ksk (h,
-                                    ksk_uri,
-                                    adv_metadata,
-                                    ns_uri,
-                                    expiration,
-                                    anonymity,
-                                    priority,
-                                    GNUNET_FS_PUBLISH_OPTION_NONE,
-                                    &post_advertising,
-                                    NULL);
-             GNUNET_FS_uri_destroy (ns_uri);
+             GNUNET_FS_namespace_advertise (h,
+                                            ksk_uri,
+                                            ns,
+                                            adv_metadata,
+                                            anonymity,
+                                            priority,                                       
+                                            expiration,
+                                            root_identifier,
+                                            &post_advertising,
+                                            NULL);
              return;
            }
+         else
+           {
+             if (ksk_uri != NULL)
+               fprintf (stderr, _("Option `%s' ignored\n"), "-k");   
+           }
        }
     }
+  else
+    {
+      if (root_identifier != NULL) 
+       fprintf (stderr, _("Option `%s' ignored\n"), "-r");
+      if (ksk_uri != NULL)
+       fprintf (stderr, _("Option `%s' ignored\n"), "-k");   
+    }    
+    
   post_advertising (NULL, NULL, NULL);
 }