]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/proto-p10.c
Fix for SF bug #2423717. Invalid automode choices with a string will now show the...
[irc/evilnet/x3.git] / src / proto-p10.c
index d6c5895835b81af913c578a562202ccf4a0e331b..d9944d7bd835b8586ae945397a65f4785a2c9753 100644 (file)
 #define CMD_SERVSET             "SERVSET"
 #define CMD_SET                        "SET"
 #define CMD_SETTIME             "SETTIME"
+#define CMD_SGLINE              "SGLINE"
 #define CMD_SHUN               "SHUN"
 #define CMD_SILENCE             "SILENCE"
+#define CMD_SMO                 "SMO"
 #define CMD_SNO                 "SNO"
+#define CMD_SSHUN              "SSHUN"
 #define CMD_SQUERY              "SQUERY"
 #define CMD_SQUIT               "SQUIT"
 #define CMD_STATS               "STATS"
 #define CMD_SVSJOIN             "SVSJOIN"
 #define CMD_SVSNICK             "SVSNICK"
 #define CMD_SVSPART             "SVSPART"
+#define CMD_SVSQUIT             "SVSQUIT"
 #define CMD_SWHOIS              "SWHOIS"
 #define CMD_TIME                "TIME"
 #define CMD_TOPIC               "TOPIC"
 #define TOK_SERVSET             "SERVSET"
 #define TOK_SET                        "SET"
 #define TOK_SETTIME             "SE"
+#define TOK_SGLINE              "SGL"
 #define TOK_SHUN               "SU"
 #define TOK_SILENCE             "U"
+#define TOK_SMO                 "SMO"
 #define TOK_SNO                 "SNO"
+#define TOK_SSHUN              "SSU"
 #define TOK_SQUERY              "SQUERY"
 #define TOK_SQUIT               "SQ"
 #define TOK_STATS               "R"
 #define TOK_SVSJOIN             "SJ"
 #define TOK_SVSNICK             "SN"
 #define TOK_SVSPART             "SP"
+#define TOK_SVSQUIT             "SX"
 #define TOK_SWHOIS              "SW"
 #define TOK_TIME                "TI"
 #define TOK_TOPIC               "T"
 #define P10_SERVSET             TYPE(SERVSET)
 #define P10_SET                        TYPE(SET)
 #define P10_SETTIME             TYPE(SETTIME)
+#define P10_SGLINE              TYPE(SGLINE)
 #define P10_SHUN               TYPE(SHUN)
 #define P10_SILENCE             TYPE(SILENCE)
+#define P10_SMO                 TYPE(SMO)
 #define P10_SNO                 TYPE(SNO)
+#define P10_SSHUN              TYPE(SSHUN)
 #define P10_SQUERY              TYPE(SQUERY)
 #define P10_SQUIT               TYPE(SQUIT)
 #define P10_STATS               TYPE(STATS)
 #define P10_SVSJOIN             TYPE(SVSJOIN)
 #define P10_SVSNICK             TYPE(SVSNICK)
 #define P10_SVSPART             TYPE(SVSPART)
+#define P10_SVSQUIT            TYPE(SVSQUIT)
 #define P10_SWHOIS              TYPE(SWHOIS)
 #define P10_TIME                TYPE(TIME)
 #define P10_TOPIC               TYPE(TOPIC)
@@ -1029,6 +1041,12 @@ irc_svspart(struct userNode *from, struct userNode *who, struct chanNode *to)
     putsock("%s " P10_SVSPART " %s %s", from->uplink->numeric, who->numeric, to->name);
 }
 
+void
+irc_svsquit(struct userNode *from, struct userNode *who, char *reason)
+{
+    putsock("%s " P10_SVSQUIT " %s :%s", from->uplink->numeric, who->numeric, reason);
+}
+
 void
 irc_kick(struct userNode *who, struct userNode *target, struct chanNode *channel, const char *msg)
 {
@@ -1555,7 +1573,8 @@ static struct {
   P(DISPLAY),        P(SEE_OPERS),      P(WIDE_GLINE),    P(FORCE_OPMODE),
   P(FORCE_LOCAL_OPMODE), P(REMOTEREHASH), P(CHECK), P(SEE_SECRET_CHAN),
   P(SHUN),           P(LOCAL_SHUN),     P(WIDE_SHUN),     P(ZLINE),
-  P(LOCAL_ZLINE),    P(WIDE_ZLINE),     P(LIST_CHAN),
+  P(LOCAL_ZLINE),    P(WIDE_ZLINE),     P(LIST_CHAN),     P(WHOIS_NOTICE),
+  P(HIDE_IDLE),      P(XTRAOP),         P(HIDE_CHANNELS),
 #undef P
   { 0, 0 }
 };
@@ -2033,17 +2052,29 @@ static CMD_FUNC(cmd_num_topic)
 
 static CMD_FUNC(cmd_num_gline)
 {
-    if (argc < 6)
-        return 0;
-    gline_add(origin, argv[3], atoi(argv[4])-now, argv[5], now, 0, 0);
+    if (argc < 7) {
+        if (argc < 6)
+            return 0;
+        else
+            gline_add(origin, argv[3], atoi(argv[4])-now, argv[5], now, 0, 0);
+    } else {
+        if (argv[5] == "+")
+          gline_add(origin, argv[3], atoi(argv[4])-now, argv[6], now, 0, 0);
+    }
     return 1;
 }
 
 static CMD_FUNC(cmd_num_shun)
 {
-    if (argc < 6)
-        return 0;
-    shun_add(origin, argv[3], atoi(argv[4])-now, argv[5], now, 0);
+    if (argc < 7) {
+        if (argc < 6)
+            return 0;
+        else
+            shun_add(origin, argv[3], atoi(argv[4])-now, argv[5], now, 0);
+    } else {
+        if (argv[5] == "+")
+            shun_add(origin, argv[3], atoi(argv[4])-now, argv[6], now, 0);
+    }
     return 1;
 }
 
@@ -2293,6 +2324,34 @@ static CMD_FUNC(cmd_gline)
         return 0;
 }
 
+static CMD_FUNC(cmd_sgline)
+{
+    struct server *sender;
+
+    if (argc < 4)
+        return 0;
+
+    if (!(sender = GetServerH(origin)))
+        return 0;
+
+    gline_add(origin, argv[1], strtoul(argv[2], NULL, 0), argv[argc-1], now, 1, 0);
+    return 1;
+}
+
+static CMD_FUNC(cmd_sshun)
+{
+    struct server *sender;
+
+    if (argc < 4)
+        return 0;
+
+    if (!(sender = GetServerH(origin)))
+        return 0;
+
+    shun_add(origin, argv[1], strtoul(argv[2], NULL, 0), argv[argc-1], now, 1);
+    return 1;
+}
+
 static CMD_FUNC(cmd_shun)
 {
     if (argc < 3)
@@ -2466,8 +2525,12 @@ init_parse(void)
     dict_insert(irc_func_dict, TOK_WHOIS, cmd_whois);
     dict_insert(irc_func_dict, CMD_GLINE, cmd_gline);
     dict_insert(irc_func_dict, TOK_GLINE, cmd_gline);
+    dict_insert(irc_func_dict, CMD_SGLINE, cmd_sgline);
+    dict_insert(irc_func_dict, TOK_SGLINE, cmd_sgline);
     dict_insert(irc_func_dict, CMD_SHUN, cmd_shun);
     dict_insert(irc_func_dict, TOK_SHUN, cmd_shun);
+    dict_insert(irc_func_dict, CMD_SSHUN, cmd_sshun);
+    dict_insert(irc_func_dict, TOK_SSHUN, cmd_sshun);
     dict_insert(irc_func_dict, CMD_OPMODE, cmd_opmode);
     dict_insert(irc_func_dict, TOK_OPMODE, cmd_opmode);
     dict_insert(irc_func_dict, CMD_CLEARMODE, cmd_clearmode);
@@ -2476,6 +2539,8 @@ init_parse(void)
     dict_insert(irc_func_dict, TOK_VERSION, cmd_version);
     dict_insert(irc_func_dict, CMD_ADMIN, cmd_admin);
     dict_insert(irc_func_dict, TOK_ADMIN, cmd_admin);
+    dict_insert(irc_func_dict, CMD_SMO, cmd_dummy);
+    dict_insert(irc_func_dict, TOK_SMO, cmd_dummy);
     dict_insert(irc_func_dict, CMD_SNO, cmd_dummy);
     dict_insert(irc_func_dict, TOK_SNO, cmd_dummy);