]> jfr.im git - irc/freenode/syn.git/commitdiff
Use syn_respond() throughout
authorStephen Bennett <redacted>
Wed, 29 Apr 2009 23:19:52 +0000 (00:19 +0100)
committerStephen Bennett <redacted>
Wed, 29 Apr 2009 23:19:52 +0000 (00:19 +0100)
facilities.c
joinrate.c
masks.c
tor.c

index f3240ddc33675df6aec4851b6b234ad11269e586..a51eb396de98d74a8f1abf1ee05981884e95f6d1 100644 (file)
@@ -418,15 +418,15 @@ void syn_cmd_facility(sourceinfo_t *si, int parc, char **parv)
 
     if (!cmd)
     {
-        command_fail(si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "FACILITY");
-        command_fail(si, fault_needmoreparams, "Syntax: FACILITY LIST|ADD|DEL|SET|ADDBL|RMBL [parameters]");
+        syn_respond(si, STR_INSUFFICIENT_PARAMS, "FACILITY");
+        syn_respond(si, "Syntax: FACILITY LIST|ADD|DEL|SET|ADDBL|RMBL [parameters]");
         return;
     }
 
     c = command_find(&syn_facility_cmds, cmd);
     if (c == NULL)
     {
-        command_fail(si, fault_badparams, "Invalid command. Possible commands are LIST ADD DEL SET ADDBL RMBL");
+        syn_respond(si, "Invalid command. Possible commands are LIST ADD DEL SET ADDBL RMBL");
         return;
     }
 
@@ -447,21 +447,21 @@ void syn_cmd_facility_list(sourceinfo_t *si, int parc, char **parv)
         if (match && 0 != strncmp(match, f->hostpart, strlen(match)))
             continue;
 
-        command_success_nodata(si, "[%d] %s (cloaking %s, %s, throttle %d/%d)",
+        syn_respond(si, "[%d] %s (cloaking %s, %s, throttle %d/%d)",
                 ++count, f->hostpart, string_from_cloak_type(f->cloaking),
                 (f->blocked > 0 ? "blocked" : (f->blocked < 0 ? "unblocked" : "not blocked")),
                 f->throttle[0], f->throttle[1]);
     }
 
-    command_success_nodata(si, "%d facilit%s configured", count, count == 1 ? "y" : "ies");
+    syn_respond(si, "%d facilit%s configured", count, count == 1 ? "y" : "ies");
 }
 
 void syn_cmd_facility_add(sourceinfo_t *si, int parc, char **parv)
 {
     if (parc < 1)
     {
-        command_fail(si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "FACILITY ADD");
-        command_fail(si, fault_needmoreparams, "Syntax: FACILITY ADD <hostpart> [cloaktype]");
+        syn_respond(si, STR_INSUFFICIENT_PARAMS, "FACILITY ADD");
+        syn_respond(si, "Syntax: FACILITY ADD <hostpart> [cloaktype]");
         return;
     }
 
@@ -476,7 +476,7 @@ void syn_cmd_facility_add(sourceinfo_t *si, int parc, char **parv)
 
     syn_report("\002FACILITY ADD\002 %s by %s", f->hostpart, get_oper_name(si));
 
-    command_success_nodata(si, "Added facility %s", f->hostpart);
+    syn_respond(si, "Added facility %s", f->hostpart);
 
     save_facilities();
 }
@@ -485,8 +485,8 @@ void syn_cmd_facility_del(sourceinfo_t *si, int parc, char **parv)
 {
     if (parc < 1)
     {
-        command_fail(si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "FACILITY DEL");
-        command_fail(si, fault_needmoreparams, "Syntax: FACILITY DEL <hostpart>");
+        syn_respond(si, STR_INSUFFICIENT_PARAMS, "FACILITY DEL");
+        syn_respond(si, "Syntax: FACILITY DEL <hostpart>");
         return;
     }
 
@@ -494,7 +494,7 @@ void syn_cmd_facility_del(sourceinfo_t *si, int parc, char **parv)
 
     if (f == NULL)
     {
-        command_fail(si, fault_badparams, "No such facility %s was found.", parv[0]);
+        syn_respond(si, "No such facility %s was found.", parv[0]);
         return;
     }
 
@@ -503,7 +503,7 @@ void syn_cmd_facility_del(sourceinfo_t *si, int parc, char **parv)
 
     syn_report("\002FACILITY DEL\002 %s by %s", parv[0], get_oper_name(si));
 
-    command_success_nodata(si, "Facility %s deleted", parv[0]);
+    syn_respond(si, "Facility %s deleted", parv[0]);
 
     save_facilities();
 }
@@ -514,15 +514,15 @@ void syn_cmd_facility_set(sourceinfo_t *si, int parc, char **parv)
 {
     if (parc < 3)
     {
-        command_fail(si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "FACILITY SET");
-        command_fail(si, fault_needmoreparams, "Syntax: FACILITY SET <hostpart> <setting> [arguments]");
+        syn_respond(si, STR_INSUFFICIENT_PARAMS, "FACILITY SET");
+        syn_respond(si, "Syntax: FACILITY SET <hostpart> <setting> [arguments]");
         return;
     }
 
     facility_t *f = mowgli_dictionary_retrieve(facilities, parv[0]);
     if (f== NULL)
     {
-        command_fail(si, fault_badparams, "No such facility %s", parv[0]);
+        syn_respond(si, "No such facility %s", parv[0]);
         return;
     }
 
@@ -533,7 +533,7 @@ void syn_cmd_facility_set(sourceinfo_t *si, int parc, char **parv)
 
         syn_report("\002FACILITY SET\002 cloaking->%s for %s by %s",
                 string_from_cloak_type(cloak), f->hostpart, get_oper_name(si));
-        command_success_nodata(si, "Cloaking method for %s set to %s", f->hostpart, string_from_cloak_type(cloak));
+        syn_respond(si, "Cloaking method for %s set to %s", f->hostpart, string_from_cloak_type(cloak));
         return;
     }
 
@@ -546,7 +546,7 @@ void syn_cmd_facility_set(sourceinfo_t *si, int parc, char **parv)
 
         syn_report("\002FACILITY SET\002 blocked->%d for %s by %s",
                 f->blocked, f->hostpart, get_oper_name(si));
-        command_success_nodata(si, "Blocked for %s was set to %d", f->hostpart, f->blocked);
+        syn_respond(si, "Blocked for %s was set to %d", f->hostpart, f->blocked);
         return;
     }
 
@@ -558,8 +558,8 @@ void syn_cmd_facility_set(sourceinfo_t *si, int parc, char **parv)
 
         if (p == NULL)
         {
-            command_fail(si, fault_badparams, STR_INVALID_PARAMS, "FACILITY SET THROTTLE");
-            command_fail(si, fault_badparams, "Syntax: FACILITY SET <name> THROTTLE n,m");
+            syn_respond(si, STR_INVALID_PARAMS, "FACILITY SET THROTTLE");
+            syn_respond(si, "Syntax: FACILITY SET <name> THROTTLE n,m");
             return;
         }
         *p++ = '\0';
@@ -569,7 +569,7 @@ void syn_cmd_facility_set(sourceinfo_t *si, int parc, char **parv)
 
         syn_report("\002FACILITY SET\002 throttle->%d/%d for %s by %s",
                 f->throttle[0], f->throttle[1], f->hostpart, get_oper_name(si));
-        command_success_nodata(si, "Throttle for %s was set to %d seconds, burst %d",
+        syn_respond(si, "Throttle for %s was set to %d seconds, burst %d",
                 f->hostpart, f->throttle[0], f->throttle[1]);
         return;
     }
@@ -586,7 +586,7 @@ void syn_cmd_facility_set(sourceinfo_t *si, int parc, char **parv)
 
         syn_report("\002FACILITY SET\002 block message->%s for %s by %s",
                 f->blockmessage, f->hostpart, get_oper_name(si));
-        command_success_nodata(si, "Block message for %s was set to %s", f->hostpart, f->blockmessage);
+        syn_respond(si, "Block message for %s was set to %s", f->hostpart, f->blockmessage);
         return;
     }
 
@@ -602,11 +602,11 @@ void syn_cmd_facility_set(sourceinfo_t *si, int parc, char **parv)
 
         syn_report("\002FACILITY SET\002 throttle message->%s for %s by %s",
                 f->throttlemessage, f->hostpart, get_oper_name(si));
-        command_success_nodata(si, "Throttle message for %s was set to %s", f->hostpart, f->throttlemessage);
+        syn_respond(si, "Throttle message for %s was set to %s", f->hostpart, f->throttlemessage);
         return;
     }
 
-    command_fail(si, fault_badparams, "Unknown setting name");
+    syn_respond(si, "Unknown setting name");
 
     save_facilities();
 }
@@ -617,15 +617,15 @@ void syn_cmd_facility_addbl(sourceinfo_t *si, int parc, char **parv)
 {
     if (parc < 2)
     {
-        command_fail(si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "FACILITY ADDBL");
-        command_fail(si, fault_needmoreparams, "Syntax: FACILITY ADDBL <hostpart> <regex>");
+        syn_respond(si, STR_INSUFFICIENT_PARAMS, "FACILITY ADDBL");
+        syn_respond(si, "Syntax: FACILITY ADDBL <hostpart> <regex>");
         return;
     }
 
     facility_t *f = mowgli_dictionary_retrieve(facilities, parv[0]);
     if (f== NULL)
     {
-        command_fail(si, fault_badparams, "No such facility %s", parv[0]);
+        syn_respond(si, "No such facility %s", parv[0]);
         return;
     }
 
@@ -636,7 +636,7 @@ void syn_cmd_facility_addbl(sourceinfo_t *si, int parc, char **parv)
     node_add(bl, node_create(), &f->blacklist);
 
     syn_report("\002FACILITY ADDBL\002 %s to %s by %s", bl->regex, f->hostpart, get_oper_name(si));
-    command_success_nodata(si, "Added blacklist \"%s\" for %s", bl->regex, f->hostpart);
+    syn_respond(si, "Added blacklist \"%s\" for %s", bl->regex, f->hostpart);
 
     save_facilities();
 }
@@ -647,15 +647,15 @@ void syn_cmd_facility_rmbl(sourceinfo_t *si, int parc, char **parv)
 {
     if (parc < 2)
     {
-        command_fail(si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "FACILITY RMBL");
-        command_fail(si, fault_needmoreparams, "Syntax: FACILITY RMBL <hostpart> <regex>");
+        syn_respond(si, STR_INSUFFICIENT_PARAMS, "FACILITY RMBL");
+        syn_respond(si, "Syntax: FACILITY RMBL <hostpart> <regex>");
         return;
     }
 
     facility_t *f = mowgli_dictionary_retrieve(facilities, parv[0]);
     if (f== NULL)
     {
-        command_fail(si, fault_badparams, "No such facility %s", parv[0]);
+        syn_respond(si, "No such facility %s", parv[0]);
         return;
     }
 
@@ -675,7 +675,7 @@ void syn_cmd_facility_rmbl(sourceinfo_t *si, int parc, char **parv)
         node_free(n);
 
         syn_report("\002FACILITY RMBL\002 %s from %s by %s", parv[1], f->hostpart, get_oper_name(si));
-        command_success_nodata(si, "Removed blacklist \"%s\" from %s", parv[1], f->hostpart);
+        syn_respond(si, "Removed blacklist \"%s\" from %s", parv[1], f->hostpart);
     }
 
     save_facilities();
@@ -685,34 +685,34 @@ void syn_cmd_facility_show(sourceinfo_t *si, int parc, char **parv)
 {
     if (parc < 1)
     {
-        command_fail(si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "FACILITY SHOW");
-        command_fail(si, fault_needmoreparams, "Syntax: FACILITY SHOW <hostpart>");
+        syn_respond(si, STR_INSUFFICIENT_PARAMS, "FACILITY SHOW");
+        syn_respond(si, "Syntax: FACILITY SHOW <hostpart>");
         return;
     }
 
     facility_t *f = mowgli_dictionary_retrieve(facilities, parv[0]);
     if (f== NULL)
     {
-        command_fail(si, fault_badparams, "No such facility %s", parv[0]);
+        syn_respond(si, "No such facility %s", parv[0]);
         return;
     }
 
-    command_success_nodata(si, "Facility %s:", f->hostpart);
-    command_success_nodata(si, "  cloaking method: %s", string_from_cloak_type(f->cloaking));
-    command_success_nodata(si, "  %s, block message \"%s\"",
+    syn_respond(si, "Facility %s:", f->hostpart);
+    syn_respond(si, "  cloaking method: %s", string_from_cloak_type(f->cloaking));
+    syn_respond(si, "  %s, block message \"%s\"",
             f->blocked > 0 ? "blocked" : ( f->blocked < 0 ? "unblocked" : "not blocked"),
             f->blockmessage);
-    command_success_nodata(si, "  Throttle rate %d/%d, throttle message \"%s\"",
+    syn_respond(si, "  Throttle rate %d/%d, throttle message \"%s\"",
             f->throttle[0], f->throttle[1], f->throttlemessage);
 
-    command_success_nodata(si, "Blacklist:");
+    syn_respond(si, "Blacklist:");
 
     int count = 0;
     node_t *n;
     LIST_FOREACH(n, f->blacklist.head)
     {
         bl_entry_t *bl = n->data;
-        command_success_nodata(si, "[%d] %s", ++count, bl->regex);
+        syn_respond(si, "[%d] %s", ++count, bl->regex);
     }
-    command_success_nodata(si, "%d blacklist entries for %s", count, f->hostpart);
+    syn_respond(si, "%d blacklist entries for %s", count, f->hostpart);
 }
index e67a9a0814335bf6e22b3d7421f31f2841215717..71204823be450ef6d27a098cd364ef87ed837ffb 100644 (file)
@@ -187,7 +187,7 @@ static void syn_cmd_showrate(sourceinfo_t *si, int parc, char **parv)
 {
     if (parc == 0)
     {
-        command_success_nodata(si, "Global warning threshold is %d seconds, %d burst", default_rate, default_burst);
+        syn_respond(si, "Global warning threshold is %d seconds, %d burst", default_rate, default_burst);
         return;
     }
 
@@ -195,11 +195,11 @@ static void syn_cmd_showrate(sourceinfo_t *si, int parc, char **parv)
 
     if (!ce || !ce->use_custom)
     {
-        command_success_nodata(si, "No custom warning threshold is set for %s", parv[0]);
+        syn_respond(si, "No custom warning threshold is set for %s", parv[0]);
         return;
     }
 
-    command_success_nodata(si, "Warning threshold for %s is %d seconds, %d burst", ce->chname, ce->rate[0], ce->rate[1]);
+    syn_respond(si, "Warning threshold for %s is %d seconds, %d burst", ce->chname, ce->rate[0], ce->rate[1]);
 }
 
 
@@ -207,8 +207,8 @@ static void syn_cmd_setrate(sourceinfo_t *si, int parc, char **parv)
 {
     if (parc < 2)
     {
-        command_fail(si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "SETRATE");
-        command_fail(si, fault_needmoreparams, _("Syntax: SETRATE [#channel] default|(<rate> <burst>)"));
+        syn_respond(si, STR_INSUFFICIENT_PARAMS, "SETRATE");
+        syn_respond(si, _("Syntax: SETRATE [#channel] default|(<rate> <burst>)"));
         return;
     }
 
@@ -220,8 +220,8 @@ static void syn_cmd_setrate(sourceinfo_t *si, int parc, char **parv)
 
         if (r * b == 0)
         {
-            command_fail(si, fault_badparams, STR_INVALID_PARAMS, "SETRATE");
-            command_fail(si, fault_needmoreparams, _("Syntax: SETRATE [#channel] default|(<rate> <burst>)"));
+            syn_respond(si, STR_INVALID_PARAMS, "SETRATE");
+            syn_respond(si, _("Syntax: SETRATE [#channel] default|(<rate> <burst>)"));
             return;
         }
 
@@ -229,7 +229,7 @@ static void syn_cmd_setrate(sourceinfo_t *si, int parc, char **parv)
         default_burst = b;
 
         syn_report("\002SETRATE\002 default->%d/%d by %s", default_rate, default_burst, get_oper_name(si));
-        command_success_nodata(si, "Warning threshold set to %d seconds, with a burst of %d", default_rate, default_burst);
+        syn_respond(si, "Warning threshold set to %d seconds, with a burst of %d", default_rate, default_burst);
         return;
     }
 
@@ -239,19 +239,19 @@ static void syn_cmd_setrate(sourceinfo_t *si, int parc, char **parv)
     {
         if (!ce || !ce->use_custom)
         {
-            command_fail(si, fault_nochange, "No custom rate settings were defined for %s", parv[0]);
+            syn_respond(si, "No custom rate settings were defined for %s", parv[0]);
             return;
         }
         ce->use_custom = false;
         syn_report("\002SETRATE\002 %s->default by %s", parv[0], get_oper_name(si));
-        command_success_nodata(si, "Custom rate settings have been disabled for %s", parv[0]);
+        syn_respond(si, "Custom rate settings have been disabled for %s", parv[0]);
         return;
     }
 
     if (parc < 3)
     {
-        command_fail(si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "SETRATE");
-        command_fail(si, fault_needmoreparams, _("Syntax: SETRATE [#channel] default|(<rate> <burst>)"));
+        syn_respond(si, STR_INSUFFICIENT_PARAMS, "SETRATE");
+        syn_respond(si, _("Syntax: SETRATE [#channel] default|(<rate> <burst>)"));
         return;
     }
 
@@ -268,8 +268,8 @@ static void syn_cmd_setrate(sourceinfo_t *si, int parc, char **parv)
 
     if (r * b == 0)
     {
-        command_fail(si, fault_badparams, STR_INVALID_PARAMS, "SETRATE");
-        command_fail(si, fault_needmoreparams, _("Syntax: SETRATE [#channel] default|(<rate> <burst>)"));
+        syn_respond(si, STR_INVALID_PARAMS, "SETRATE");
+        syn_respond(si, _("Syntax: SETRATE [#channel] default|(<rate> <burst>)"));
         return;
     }
 
@@ -278,5 +278,5 @@ static void syn_cmd_setrate(sourceinfo_t *si, int parc, char **parv)
     ce->rate[1] = b;
 
     syn_report("\002SETRATE\002 %s->%d/%d by %s", parv[0], r, b, get_oper_name(si));
-    command_success_nodata(si, "Warning threshold for %s set to %d seconds, with a burst of %d", parv[0], r, b);
+    syn_respond(si, "Warning threshold for %s set to %d seconds, with a burst of %d", parv[0], r, b);
 }
diff --git a/masks.c b/masks.c
index 851b56b3efcb625fcda1b288d08f237767fd3f5d..73023ce01c55b77ceab5e73d73c8d0b1d2c31c49 100644 (file)
--- a/masks.c
+++ b/masks.c
@@ -194,16 +194,16 @@ void syn_cmd_addmask(sourceinfo_t *si, int parc, char **parv)
 
     if (args == NULL)
     {
-        command_fail(si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "ADDMASK");
-        command_fail(si, fault_needmoreparams, "Syntax: ADDMASK /<regex>/[i] <type>");
+        syn_respond(si, STR_INSUFFICIENT_PARAMS, "ADDMASK");
+        syn_respond(si, "Syntax: ADDMASK /<regex>/[i] <type>");
         return;
     }
 
     pattern = regex_extract(args, &args, &flags);
     if (pattern == NULL)
     {
-        command_fail(si, fault_badparams, STR_INVALID_PARAMS, "ADDMASK");
-        command_fail(si, fault_badparams, "Syntax: ADDMASK /<regex>/[i] <type>");
+        syn_respond(si, STR_INVALID_PARAMS, "ADDMASK");
+        syn_respond(si, "Syntax: ADDMASK /<regex>/[i] <type>");
         return;
     }
 
@@ -211,15 +211,15 @@ void syn_cmd_addmask(sourceinfo_t *si, int parc, char **parv)
 
     if (*stype == '\0')
     {
-        command_fail(si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "ADDMASK");
-        command_fail(si, fault_needmoreparams, "Syntax: ADDMASK /<regex>/[i] <type>");
+        syn_respond(si, STR_INSUFFICIENT_PARAMS, "ADDMASK");
+        syn_respond(si, "Syntax: ADDMASK /<regex>/[i] <type>");
         return;
     }
 
     type = mask_type_from_string(stype);
     if (type == mask_unknown)
     {
-        command_fail(si, fault_badparams, "Invalid mask type \2%s\2.", stype);
+        syn_respond(si, "Invalid mask type \2%s\2.", stype);
         return;
     }
 
@@ -236,7 +236,7 @@ void syn_cmd_addmask(sourceinfo_t *si, int parc, char **parv)
 
         if (0 == strcmp(m->regex, pattern))
         {
-            command_fail(si, fault_nochange, "\2%s\2 was already added (%s); not re-adding", pattern, string_from_mask_type(m->type));
+            syn_respond(si, "\2%s\2 was already added (%s); not re-adding", pattern, string_from_mask_type(m->type));
             return;
         }
     }
@@ -244,7 +244,7 @@ void syn_cmd_addmask(sourceinfo_t *si, int parc, char **parv)
     atheme_regex_t *regex = regex_create(pattern, flags);
     if (regex == NULL)
     {
-        command_fail(si, fault_badparams, "The provided regex \2%s\2 is invalid.", pattern);
+        syn_respond(si, "The provided regex \2%s\2 is invalid.", pattern);
         return;
     }
 
@@ -262,7 +262,7 @@ void syn_cmd_addmask(sourceinfo_t *si, int parc, char **parv)
 
     syn_report("\002ADDMASK\002 %s (%s) by %s, expires %s",
             pattern, stype, get_oper_name(si), syn_format_expiry(newmask->expires));
-    command_success_nodata(si, "Added \2%s\2 to %s mask list, expiring %s.",
+    syn_respond(si, "Added \2%s\2 to %s mask list, expiring %s.",
                             pattern, stype, syn_format_expiry(newmask->expires));
 }
 
@@ -272,8 +272,8 @@ void syn_cmd_delmask(sourceinfo_t *si, int parc, char **parv)
 
     if (!args)
     {
-        command_fail(si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "DELMASK");
-        command_fail(si, fault_needmoreparams, "Syntax: DELMASK /<regex>/");
+        syn_respond(si, STR_INSUFFICIENT_PARAMS, "DELMASK");
+        syn_respond(si, "Syntax: DELMASK /<regex>/");
         return;
     }
 
@@ -282,8 +282,8 @@ void syn_cmd_delmask(sourceinfo_t *si, int parc, char **parv)
 
     if (!pattern)
     {
-        command_fail(si, fault_badparams, STR_INVALID_PARAMS, "DELMASK");
-        command_fail(si, fault_needmoreparams, "Syntax: DELMASK /<regex>/");
+        syn_respond(si, STR_INVALID_PARAMS, "DELMASK");
+        syn_respond(si, "Syntax: DELMASK /<regex>/");
         return;
     }
 
@@ -294,7 +294,7 @@ void syn_cmd_delmask(sourceinfo_t *si, int parc, char **parv)
         if (0 == strcmp(pattern, m->regex))
         {
             syn_report("\002DELMASK\002 %s (%s) by %s", pattern, string_from_mask_type(m->type), get_oper_name(si));
-            command_success_nodata(si, "Removing \2%s\2 from %s mask list", pattern, string_from_mask_type(m->type));
+            syn_respond(si, "Removing \2%s\2 from %s mask list", pattern, string_from_mask_type(m->type));
             regex_destroy(m->re);
             free(m->regex);
             free(m);
@@ -303,7 +303,7 @@ void syn_cmd_delmask(sourceinfo_t *si, int parc, char **parv)
         }
     }
 
-    command_fail(si, fault_nochange, "\2%s\2 was not found in any mask list", pattern);
+    syn_respond(si, "\2%s\2 was not found in any mask list", pattern);
 }
 
 void syn_cmd_setmask(sourceinfo_t *si, int parc, char **parv)
@@ -312,8 +312,8 @@ void syn_cmd_setmask(sourceinfo_t *si, int parc, char **parv)
 
     if (!args)
     {
-        command_fail(si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "SETMASK");
-        command_fail(si, fault_needmoreparams, "Syntax: SETMASK /<regex>/");
+        syn_respond(si, STR_INSUFFICIENT_PARAMS, "SETMASK");
+        syn_respond(si, "Syntax: SETMASK /<regex>/");
         return;
     }
 
@@ -322,8 +322,8 @@ void syn_cmd_setmask(sourceinfo_t *si, int parc, char **parv)
 
     if (!pattern)
     {
-        command_fail(si, fault_badparams, STR_INVALID_PARAMS, "SETMASK");
-        command_fail(si, fault_needmoreparams, "Syntax: SETMASK /<regex>/");
+        syn_respond(si, STR_INVALID_PARAMS, "SETMASK");
+        syn_respond(si, "Syntax: SETMASK /<regex>/");
         return;
     }
 
@@ -339,7 +339,7 @@ void syn_cmd_setmask(sourceinfo_t *si, int parc, char **parv)
 
     if (!m)
     {
-        command_fail(si, fault_nochange, "\2%s\2 was not found in any mask list", pattern);
+        syn_respond(si, "\2%s\2 was not found in any mask list", pattern);
         return;
     }
 
@@ -349,7 +349,7 @@ void syn_cmd_setmask(sourceinfo_t *si, int parc, char **parv)
     {
         m->type = t;
         syn_report("\002SETMASK\002 %s type->%s by %s", pattern, nextarg, get_oper_name(si));
-        command_success_nodata(si, "Changed type of mask \2%s\2 to %s", pattern, nextarg);
+        syn_respond(si, "Changed type of mask \2%s\2 to %s", pattern, nextarg);
         return;
     }
 
@@ -360,19 +360,19 @@ void syn_cmd_setmask(sourceinfo_t *si, int parc, char **parv)
         {
             m->expires = CURRTIME + duration * 60;
             syn_report("\002SETMASK\002 %s duration->%d by %s", pattern, duration, get_oper_name(si));
-            command_success_nodata(si, "Changed expiry of mask \2%s\2 to %ld minutes", pattern, duration);
+            syn_respond(si, "Changed expiry of mask \2%s\2 to %ld minutes", pattern, duration);
         }
         else
         {
             m->expires = 0;
             syn_report("\002SETMASK\002 %s expiry->off by %s", pattern, get_oper_name(si));
-            command_success_nodata(si, "Expiry disabled for mask \2%s\2.", pattern);
+            syn_respond(si, "Expiry disabled for mask \2%s\2.", pattern);
         }
         return;
     }
 
-    command_fail(si, fault_badparams, STR_INVALID_PARAMS, "SETMASK");
-    command_fail(si, fault_badparams, "Syntax: SETMASK /<regex>/ <type>");
+    syn_respond(si, STR_INVALID_PARAMS, "SETMASK");
+    syn_respond(si, "Syntax: SETMASK /<regex>/ <type>");
 }
 
 void syn_cmd_listmask(sourceinfo_t *si, int parc, char **parv)
@@ -394,11 +394,11 @@ void syn_cmd_listmask(sourceinfo_t *si, int parc, char **parv)
         if (t != mask_unknown && t != m->type)
             continue;
 
-        command_success_nodata(si, "\2%s\2 (%s), expires %s",
+        syn_respond(si, "\2%s\2 (%s), expires %s",
                 m->regex, string_from_mask_type(m->type), syn_format_expiry(m->expires));
 
         ++count;
     }
 
-    command_success_nodata(si, "%d masks found", count);
+    syn_respond(si, "%d masks found", count);
 }
diff --git a/tor.c b/tor.c
index ce0bb53a0aba1d3a607dc894bba3d3c1f5eb294b..2b9b45fadbb1028f5a211d25d6138d72a259ab16 100644 (file)
--- a/tor.c
+++ b/tor.c
@@ -117,8 +117,8 @@ static void syn_cmd_checktor(sourceinfo_t *si, int parc, char **parv)
 {
     if (!parv[0])
     {
-        command_fail(si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "CHECKTOR");
-        command_fail(si, fault_needmoreparams, _("Syntax: CHECKTOR <IP|user>"));
+        syn_respond(si, STR_INSUFFICIENT_PARAMS, "CHECKTOR");
+        syn_respond(si, _("Syntax: CHECKTOR <IP|user>"));
         return;
     }
 
@@ -130,7 +130,7 @@ static void syn_cmd_checktor(sourceinfo_t *si, int parc, char **parv)
         user_t *target_u = user_find_named(parv[0]);
         if (!target_u)
         {
-            command_fail(si, fault_nosuch_target, _("\2%s\2 is not online."), parv[0]);
+            syn_respond(si, _("\2%s\2 is not online."), parv[0]);
             return;
         }
         test = target_u->ip;
@@ -138,6 +138,6 @@ static void syn_cmd_checktor(sourceinfo_t *si, int parc, char **parv)
 
     p = mowgli_patricia_retrieve(torlist, test);
 
-    command_success_nodata(si, _("\2%s\2 is %s as a tor node."), test, p != NULL ? "listed" : "not listed");
+    syn_respond(si, _("\2%s\2 is %s as a tor node."), test, p != NULL ? "listed" : "not listed");
 }