]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Handle 'weight' and 'flag' for fuzzy commands.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 30 Apr 2014 22:44:29 +0000 (15:44 -0700)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 30 Apr 2014 22:44:29 +0000 (15:44 -0700)
src/client/rspamc.c

index 6093161dba0c856e0a1c2c50b5b622da650b0a79..419b3c6fbd9f1cd408d899b533500e4b24189245 100644 (file)
@@ -327,6 +327,8 @@ print_commands_list (void)
 static void
 add_options (GHashTable *opts)
 {
+       GString *numbuf;
+
        if (ip != NULL) {
                g_hash_table_insert (opts, "Ip", ip);
        }
@@ -354,6 +356,16 @@ add_options (GHashTable *opts)
        if (pass_all) {
                g_hash_table_insert (opts, "Pass", "all");
        }
+       if (weight != 0) {
+               numbuf = g_string_sized_new (8);
+               rspamd_printf_gstring (numbuf, "%d", weight);
+               g_hash_table_insert (opts, "Weight", numbuf->str);
+       }
+       if (flag != 0) {
+               numbuf = g_string_sized_new (8);
+               rspamd_printf_gstring (numbuf, "%d", flag);
+               g_hash_table_insert (opts, "Flag", numbuf->str);
+       }
 }
 
 static void