]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/proto-p10.c
an initial fix to the vsend error, now we just need to do the reg_auth_func bits...
[irc/evilnet/x3.git] / src / proto-p10.c
index 72be5ecb9a5ad948aba98831e6b25cb2e996b562..1f82782f63b0b679ac8fa0936fb28917594acced 100644 (file)
 #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_WHO                 "H"
 #define TOK_WHOIS               "W"
 #define TOK_WHOWAS              "X"
-#define TOK_EXEMPT             "EX"
 
 /* Protocol messages; aliased to full commands or tokens depending
    on compile-time configuration. ircu prefers tokens WITH THE
@@ -714,6 +714,16 @@ irc_mode(struct userNode *from, struct chanNode *target, const char *modes)
             target->name, modes, target->timestamp);
 }
 
+/* Added to allow services to mode users
+   2005 - 8 - 10 by Life4Christ
+*/
+void
+irc_umode(struct userNode *target, const char *modes)
+{
+    putsock("%s " P10_MODE " %s %s ",self->numeric,target->nick, modes);
+}
+
+
 void
 irc_invite(struct userNode *from, struct userNode *who, struct chanNode *to)
 {
@@ -1699,8 +1709,14 @@ 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);
+    dict_insert(irc_func_dict, TOK_WALLUSERS, 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);
+    /* Ignore remote luser */
+    dict_insert(irc_func_dict, TOK_LUSERS, 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);
@@ -2130,8 +2146,9 @@ DelUser(struct userNode* user, struct userNode *killer, int announce, const char
         free_user(user);
 }
 
+static void call_oper_funcs(struct userNode *user);
+
 void mod_usermode(struct userNode *user, const char *mode_change) {
-    static void call_oper_funcs(struct userNode *user);
     int add = 1;
     const char *word = mode_change;
 
@@ -2146,13 +2163,15 @@ void mod_usermode(struct userNode *user, const char *mode_change) {
        case '+': add = 1; break;
        case '-': add = 0; break;
        case 'o':
-           do_user_mode(FLAGS_OPER);
            if (add) {
-               userList_append(&curr_opers, user);
-               call_oper_funcs(user);
+                if(!IsOper(user)) { /* Dont re-oper an oper */
+                    userList_append(&curr_opers, user);
+                    call_oper_funcs(user);
+                }
            } else {
                userList_remove(&curr_opers, user);
            }
+           do_user_mode(FLAGS_OPER);
            break;
        case 'O': do_user_mode(FLAGS_LOCOP); break;
        case 'i': do_user_mode(FLAGS_INVISIBLE);
@@ -2251,6 +2270,7 @@ mod_chanmode_parse(struct chanNode *channel, char **modes, unsigned int argc, un
         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 'L': do_chan_mode(MODE_HIDEMODE); break;
        case 'z':
          if (!(flags & MCP_REGISTERED)) {
           do_chan_mode(MODE_REGISTERED);
@@ -2259,8 +2279,6 @@ mod_chanmode_parse(struct chanNode *channel, char **modes, unsigned int argc, un
           return NULL;
          }
          break;
-//   uncomment this when ssl is enabled on the network.
-//        case 'Z': do_chan_mode(MODE_SSLONLY); break;
 #undef do_chan_mode
         case 'l':
             if (add) {
@@ -2429,6 +2447,7 @@ mod_chanmode_announce(struct userNode *who, struct chanNode *channel, struct mod
         DO_MODE_CHAR(OPERSONLY, 'O');
         DO_MODE_CHAR(REGISTERED, 'z');
         DO_MODE_CHAR(SSLONLY, 'Z');
+       DO_MODE_CHAR(HIDEMODE, 'L');
 #undef DO_MODE_CHAR
         if (change->modes_clear & channel->modes & MODE_KEY)
             mod_chanmode_append(&chbuf, 'k', channel->key);
@@ -2480,6 +2499,7 @@ mod_chanmode_announce(struct userNode *who, struct chanNode *channel, struct mod
         DO_MODE_CHAR(OPERSONLY, 'O');
         DO_MODE_CHAR(REGISTERED, 'z');
         DO_MODE_CHAR(SSLONLY, 'Z');
+       DO_MODE_CHAR(HIDEMODE, 'L');
 #undef DO_MODE_CHAR
         if(change->modes_set & MODE_KEY)
             mod_chanmode_append(&chbuf, 'k', change->new_key);
@@ -2548,6 +2568,7 @@ mod_chanmode_format(struct mod_chanmode *change, char *outbuff)
         DO_MODE_CHAR(OPERSONLY, 'O');
         DO_MODE_CHAR(REGISTERED, 'z');
         DO_MODE_CHAR(SSLONLY, 'Z');
+       DO_MODE_CHAR(HIDEMODE, 'L');
 #undef DO_MODE_CHAR
     }
     if (change->modes_set) {
@@ -2571,6 +2592,7 @@ mod_chanmode_format(struct mod_chanmode *change, char *outbuff)
         DO_MODE_CHAR(OPERSONLY, 'O');
         DO_MODE_CHAR(REGISTERED, 'z');
         DO_MODE_CHAR(SSLONLY, 'Z');
+       DO_MODE_CHAR(HIDEMODE, 'L');
 #undef DO_MODE_CHAR
         switch (change->modes_set & (MODE_KEY|MODE_LIMIT)) {
         case MODE_KEY|MODE_LIMIT:
@@ -2626,6 +2648,7 @@ clear_chanmode(struct chanNode *channel, const char *modes)
         case 'O': remove |= MODE_OPERSONLY; break;
         case 'z': remove |= MODE_REGISTERED; break;
         case 'Z': remove |= MODE_SSLONLY; break;
+       case 'L': remove |= MODE_HIDEMODE; break;
         }
     }