aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-12-20 21:13:45 +0000
committerChristian Grothoff <christian@grothoff.org>2013-12-20 21:13:45 +0000
commit843c6b6ab954afae05b920ecc01d7eaa04bea03e (patch)
tree215c3e474b311a6db6183ac47298630c8042fffc
parent9e76523b9ad1ad8c1e5386a64cc65389a57f197b (diff)
downloadgnunet-gtk-843c6b6ab954afae05b920ecc01d7eaa04bea03e.tar.gz
gnunet-gtk-843c6b6ab954afae05b920ecc01d7eaa04bea03e.zip
-have non-infinite nick expiration time by default
-rw-r--r--src/namestore/Makefile.am7
-rw-r--r--src/namestore/gnunet-namestore-gtk.c32
-rw-r--r--src/namestore/gnunet-namestore-gtk.conf2
3 files changed, 34 insertions, 7 deletions
diff --git a/src/namestore/Makefile.am b/src/namestore/Makefile.am
index 6417f9c1..46faba72 100644
--- a/src/namestore/Makefile.am
+++ b/src/namestore/Makefile.am
@@ -3,6 +3,7 @@ SUBDIRS = .
3# we use libgnunetutil to load plugins, and it 3# we use libgnunetutil to load plugins, and it
4# only looks in /gnunet, not /gnunet-gtk! 4# only looks in /gnunet, not /gnunet-gtk!
5plugindir = $(libdir)/gnunet 5plugindir = $(libdir)/gnunet
6pkgcfgdir= $(prefix)/share/gnunet/config.d/
6 7
7AM_CPPFLAGS = \ 8AM_CPPFLAGS = \
8 -I$(top_srcdir)/ \ 9 -I$(top_srcdir)/ \
@@ -10,6 +11,12 @@ AM_CPPFLAGS = \
10 11
11bin_PROGRAMS = gnunet-namestore-gtk 12bin_PROGRAMS = gnunet-namestore-gtk
12 13
14pkgcfg_DATA = \
15 gnunet-namestore-gtk.conf
16
17EXTRA_DIST = \
18 $(pkgcfg_DATA)
19
13gnunet_namestore_gtk_SOURCES = \ 20gnunet_namestore_gtk_SOURCES = \
14 gnunet-namestore-gtk.c \ 21 gnunet-namestore-gtk.c \
15 gnunet-namestore-gtk_edit.c 22 gnunet-namestore-gtk_edit.c
diff --git a/src/namestore/gnunet-namestore-gtk.c b/src/namestore/gnunet-namestore-gtk.c
index 7b3e1f9f..cea5ce0c 100644
--- a/src/namestore/gnunet-namestore-gtk.c
+++ b/src/namestore/gnunet-namestore-gtk.c
@@ -304,8 +304,10 @@ struct RecordInfo
304}; 304};
305 305
306 306
307 307/**
308 308 * When do NICK records expire?
309 */
310static struct GNUNET_TIME_Relative nick_expiration_time;
309 311
310/** 312/**
311 * Hash map from the H(name) in the zone to the 'struct RecordInfo' 313 * Hash map from the H(name) in the zone to the 'struct RecordInfo'
@@ -2139,8 +2141,8 @@ gnunet_namestore_gtk_pseu_entry_changed_cb (GtkEditable *editable,
2139 else 2141 else
2140 { 2142 {
2141 rd_new[off].record_type = GNUNET_GNSRECORD_TYPE_NICK; 2143 rd_new[off].record_type = GNUNET_GNSRECORD_TYPE_NICK;
2142 rd_new[off].expiration_time = UINT64_MAX; 2144 rd_new[off].expiration_time = nick_expiration_time.rel_value_us;
2143 rd_new[off].flags = GNUNET_GNSRECORD_RF_PRIVATE; 2145 rd_new[off].flags = GNUNET_GNSRECORD_RF_PRIVATE | GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
2144 rd_new[off].data_size = strlen (pseu) + 1; 2146 rd_new[off].data_size = strlen (pseu) + 1;
2145 rd_new[off].data = pseu; 2147 rd_new[off].data = pseu;
2146 } 2148 }
@@ -2745,16 +2747,32 @@ run (void *cls,
2745 2747
2746 ml = cls; 2748 ml = cls;
2747 cfg = GNUNET_GTK_main_loop_get_configuration (ml); 2749 cfg = GNUNET_GTK_main_loop_get_configuration (ml);
2748 if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, NULL)) 2750 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
2751 &cleanup_task, NULL);
2752 if (GNUNET_OK !=
2753 GNUNET_CONFIGURATION_get_value_time (cfg,
2754 "namestore-gtk",
2755 "NICK_EXPIRATION",
2756 &nick_expiration_time))
2757 {
2758 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
2759 "namestore-gtk",
2760 "NICK_EXPIRATION");
2761 GNUNET_SCHEDULER_shutdown ();
2749 return; 2762 return;
2763 }
2764 if (GNUNET_OK !=
2765 GNUNET_GTK_main_loop_build_window (ml, NULL))
2766 {
2767 GNUNET_SCHEDULER_shutdown ();
2768 return;
2769 }
2750 GNUNET_GTK_set_icon_search_path (); 2770 GNUNET_GTK_set_icon_search_path ();
2751 GNUNET_GTK_setup_nls (); 2771 GNUNET_GTK_setup_nls ();
2752 2772
2753 main_window = GTK_WIDGET (get_object ("gnunet_namestore_gtk_dialog")); 2773 main_window = GTK_WIDGET (get_object ("gnunet_namestore_gtk_dialog"));
2754 main_window = GNUNET_GTK_plug_me ("GNUNET_NAMESTORE_GTK_PLUG", 2774 main_window = GNUNET_GTK_plug_me ("GNUNET_NAMESTORE_GTK_PLUG",
2755 main_window); 2775 main_window);
2756 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
2757 &cleanup_task, NULL);
2758 2776
2759 namestore = GNUNET_NAMESTORE_connect (cfg); 2777 namestore = GNUNET_NAMESTORE_connect (cfg);
2760 if (NULL == namestore) 2778 if (NULL == namestore)
diff --git a/src/namestore/gnunet-namestore-gtk.conf b/src/namestore/gnunet-namestore-gtk.conf
new file mode 100644
index 00000000..00d3f8e9
--- /dev/null
+++ b/src/namestore/gnunet-namestore-gtk.conf
@@ -0,0 +1,2 @@
1[namestore-gtk]
2NICK_EXPIRATION = 1 week \ No newline at end of file