]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/proto-p10.c
forget about the last commit, now we can filter out OpServ stuff in LAST
[irc/evilnet/x3.git] / src / proto-p10.c
index 39348bcf3bed6208d8672e77866fd28e8ace34e1..94aecec605590278a79ecbc38983a4930119776f 100644 (file)
@@ -1,7 +1,7 @@
 /* proto-p10.c - IRC protocol output
  * Copyright 2000-2004 srvx Development Team
  *
- * This file is part of srvx.
+ * This file is part of x3.
  *
  * srvx is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
  * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 
+#include "chanserv.h"
 #include "proto-common.c"
 
 /* Full commands. */
@@ -55,6 +56,7 @@
 #define CMD_LIST                "LIST"
 #define CMD_LUSERS              "LUSERS"
 #define CMD_MAP                 "MAP"
+#define CMD_MARK                "MARK"
 #define CMD_MODE                "MODE"
 #define CMD_MOTD                "MOTD"
 #define CMD_NAMES               "NAMES"
 #define TOK_EOB                 "EB"
 #define TOK_EOB_ACK             "EA"
 #define TOK_ERROR               "Y"
+#define TOK_EXEMPT             "EX"
 #define TOK_FAKEHOST            "FA"
 #define TOK_GET                        "GET"
 #define TOK_GLINE               "GL"
 #define TOK_LIST                "LIST"
 #define TOK_LUSERS              "LU"
 #define TOK_MAP                 "MAP"
+#define TOK_MARK                "MK"
 #define TOK_MODE                "M"
 #define TOK_MOTD                "MO"
 #define TOK_NAMES               "E"
 #define P10_LIST                TYPE(LIST)
 #define P10_LUSERS              TYPE(LUSERS)
 #define P10_MAP                 TYPE(MAP)
+#define P10_MARK                TYPE(MARK)
 #define P10_MODE                TYPE(MODE)
 #define P10_MOTD                TYPE(MOTD)
 #define P10_NAMES               TYPE(NAMES)
 #define P10_WHO                 TYPE(WHO)
 #define P10_WHOIS               TYPE(WHOIS)
 #define P10_WHOWAS              TYPE(WHOWAS)
+#define P10_EXEMPT             TYPE(EXEMPT)
 
 /* Servers claiming to have a boot or link time before PREHISTORY
  * trigger errors to the log.  We hope no server has been running
@@ -1143,8 +1149,10 @@ static CMD_FUNC(cmd_burst)
               if (ctype == 1) {
                 if (bcheck == 0) {
                   /* strip % char off start of very first ban */
-                  strncat(banlist, strtok(parm, "%"), sizeof(banlist) - 1 - strlen(banlist));
-                  strncat(banlist, " ", sizeof(banlist) - 1 - strlen(banlist));
+                  if (strlen(parm) > 1) {
+                    strncat(banlist, strtok(parm, "%"), sizeof(banlist) - 1 - strlen(banlist));
+                    strncat(banlist, " ", sizeof(banlist) - 1 - strlen(banlist));
+                  }
                   bcheck = 1;
                 } else {
                   strncat(banlist, parm, sizeof(banlist) - 1 - strlen(banlist));
@@ -1691,6 +1699,11 @@ init_parse(void)
     dict_insert(irc_func_dict, TOK_WALLOPS, cmd_dummy);
     dict_insert(irc_func_dict, CMD_WALLHOPS, cmd_dummy);
     dict_insert(irc_func_dict, TOK_WALLHOPS, cmd_dummy);
+    /* Ignore dnsbl exemptions */
+    dict_insert(irc_func_dict, TOK_EXEMPT, cmd_dummy);
+    dict_insert(irc_func_dict, TOK_MARK, cmd_dummy);
+    /* Ignore privs */
+    dict_insert(irc_func_dict, TOK_PRIVS, cmd_dummy);
     /* We have reliable clock!  Always!  Wraaa! */
     dict_insert(irc_func_dict, CMD_SETTIME, cmd_dummy);
     dict_insert(irc_func_dict, TOK_SETTIME, cmd_dummy);
@@ -1951,6 +1964,7 @@ AddService(const char *nick, const char *modes, const char *desc, const char *ho
     if (!hostname)
         hostname = self->name;
     make_numeric(self, local_num, numeric);
+    /* TODO: Make these modes part of the conf file */
     return AddUser(self, nick, nick, hostname, modes ? modes : "+oik", numeric, desc, now, "AAAAAA");
 }
 
@@ -2078,6 +2092,9 @@ DelUser(struct userNode* user, struct userNode *killer, int announce, const char
     /* mark them as dead, in case anybody cares */
     user->dead = 1;
 
+    /* remove pending adduser commands */
+    wipe_adduser_pending(NULL, user);
+
     /* remove user from all channels */
     while (user->channels.used > 0)
         DelChannelUser(user, user->channels.list[user->channels.used-1]->channel, false, 0);
@@ -2236,6 +2253,7 @@ mod_chanmode_parse(struct chanNode *channel, char **modes, unsigned int argc, un
         case 'Q': do_chan_mode(MODE_NOQUITMSGS); break;
         case 'T': do_chan_mode(MODE_NOAMSG); break;
         case 'O': do_chan_mode(MODE_OPERSONLY); break;
+        case 'Z': do_chan_mode(MODE_SSLONLY); break;
        case 'z':
          if (!(flags & MCP_REGISTERED)) {
           do_chan_mode(MODE_REGISTERED);
@@ -2413,8 +2431,7 @@ mod_chanmode_announce(struct userNode *who, struct chanNode *channel, struct mod
         DO_MODE_CHAR(NOAMSG, 'T');
         DO_MODE_CHAR(OPERSONLY, 'O');
         DO_MODE_CHAR(REGISTERED, 'z');
-        // uncomment this for ssl support
-        //DO_MODE_CHAR(SSLONLY, 'Z');
+        DO_MODE_CHAR(SSLONLY, 'Z');
 #undef DO_MODE_CHAR
         if (change->modes_clear & channel->modes & MODE_KEY)
             mod_chanmode_append(&chbuf, 'k', channel->key);
@@ -2465,8 +2482,7 @@ mod_chanmode_announce(struct userNode *who, struct chanNode *channel, struct mod
         DO_MODE_CHAR(NOAMSG, 'T');
         DO_MODE_CHAR(OPERSONLY, 'O');
         DO_MODE_CHAR(REGISTERED, 'z');
-        // uncomment this for ssl support
-        //DO_MODE_CHAR(SSLONLY, 'Z');
+        DO_MODE_CHAR(SSLONLY, 'Z');
 #undef DO_MODE_CHAR
         if(change->modes_set & MODE_KEY)
             mod_chanmode_append(&chbuf, 'k', change->new_key);
@@ -2534,8 +2550,7 @@ mod_chanmode_format(struct mod_chanmode *change, char *outbuff)
         DO_MODE_CHAR(NOAMSG, 'T');
         DO_MODE_CHAR(OPERSONLY, 'O');
         DO_MODE_CHAR(REGISTERED, 'z');
-        // uncomment this for ssl support
-        //DO_MODE_CHAR(SSLONLY, 'Z');
+        DO_MODE_CHAR(SSLONLY, 'Z');
 #undef DO_MODE_CHAR
     }
     if (change->modes_set) {
@@ -2558,8 +2573,7 @@ mod_chanmode_format(struct mod_chanmode *change, char *outbuff)
         DO_MODE_CHAR(NOAMSG, 'T');
         DO_MODE_CHAR(OPERSONLY, 'O');
         DO_MODE_CHAR(REGISTERED, 'z');
-        // uncomment this for ssl support
-        //DO_MODE_CHAR(SSLONLY, 'Z');
+        DO_MODE_CHAR(SSLONLY, 'Z');
 #undef DO_MODE_CHAR
         switch (change->modes_set & (MODE_KEY|MODE_LIMIT)) {
         case MODE_KEY|MODE_LIMIT:
@@ -2605,7 +2619,7 @@ clear_chanmode(struct chanNode *channel, const char *modes)
         case 'e': remove |= MODE_EXEMPT; break;
         case 'D': remove |= MODE_DELAYJOINS; break;
         case 'r': remove |= MODE_REGONLY; break;
-        case 'c': remove |= MODE_NOCOLORS;
+        case 'c': remove |= MODE_NOCOLORS; break;
         case 'C': remove |= MODE_NOCTCPS; break;
         case 'S': remove |= MODE_STRIPCOLOR; break;
         case 'M': remove |= MODE_MODUNREG; break;
@@ -2614,6 +2628,7 @@ clear_chanmode(struct chanNode *channel, const char *modes)
         case 'T': remove |= MODE_NOAMSG; break;
         case 'O': remove |= MODE_OPERSONLY; break;
         case 'z': remove |= MODE_REGISTERED; break;
+        case 'Z': remove |= MODE_SSLONLY; break;
         }
     }