Add autosave setting.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 23 Nov 2007 18:06:24 +0000 (19:06 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Fri, 23 Nov 2007 18:06:24 +0000 (19:06 +0100)
NEWS
src/admin.c

diff --git a/NEWS b/NEWS
index f2c603ac1aca3849d7f72974b17933fffae0ba48..8274767305181f6c72cd2743d98437549c9b4b78 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@ Ctrlproxy 3.0.5 UNRELEASED
   
     * Integrate auto-away module into the core.
 
+       * New setting ``autosave''
+
 Ctrlproxy 3.0.4 UNRELEASED
 
   IMPROVEMENTS
index 3a5b8954a7e5c57d7e8f8180fea1e186b72a7507..186afbf8d4f71e63cf4faea272ca8254e5f2c3eb 100644 (file)
@@ -1003,6 +1003,20 @@ static gboolean report_time_set(admin_handle h, const char *value)
        return interpret_boolean(h, value, &g->config->report_time);
 }
 
+static gboolean autosave_set(admin_handle h, const char *value)
+{
+       struct global *g = admin_get_global(h);
+
+       return interpret_boolean(h, value, &g->config->autosave);
+}
+
+static char *autosave_get(admin_handle h)
+{
+       struct global *g = admin_get_global(h);
+
+       return g_strdup(g->config->autosave?"true":"false");
+}
+
 static struct admin_setting {
        const char *name;
        char *(*get) (admin_handle h);
@@ -1011,6 +1025,7 @@ static struct admin_setting {
        { "log_level", log_level_get, log_level_set },
        { "motd-file", motd_file_get, motd_file_set },
        { "report-time", report_time_get, report_time_set },
+       { "autosave", autosave_get, autosave_set },
        { NULL, NULL, NULL }
 };