]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/s_user.c
Make KICK and INVITE send snotes on override.
[irc/rqf/shadowircd.git] / src / s_user.c
index 441012c32f9a2adabe13f8f0886a1677a37a6253..062b0ed12efd61207de82194750c7b1ebb3f4e1e 100644 (file)
@@ -73,7 +73,7 @@ int user_modes[256] = {
        UMODE_DEAF,             /* D */
        0,                      /* E */
        0,                      /* F */
-       0,                      /* G */
+       UMODE_SCALLERID,        /* G */
        0,                      /* H */
        0,                      /* I */
        0,                      /* J */
@@ -109,7 +109,7 @@ int user_modes[256] = {
        0,                      /* m */
        0,                      /* n */
        UMODE_OPER,             /* o */
-       0,                      /* p */
+       UMODE_OVERRIDE,         /* p */
        0,                      /* q */
        0,                      /* r */
        UMODE_SERVNOTICE,       /* s */
@@ -1138,6 +1138,12 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char
                source_p->umodes &= ~UMODE_ADMIN;
        }
 
+       if(MyConnect(source_p) && (source_p->umodes & UMODE_OVERRIDE) && (!IsOperOverride(source_p)))
+       {
+               sendto_one_notice(source_p, ":*** You need oper and the override flag for +p");
+               source_p->umodes &= ~UMODE_OVERRIDE;
+       }
+
        /* let modules providing usermodes know that we've changed our usermode --nenolod */
        hdata.client = source_p;
        hdata.oldumodes = setflags;
@@ -1304,6 +1310,23 @@ oper_up(struct Client *source_p, struct oper_conf *oper_p)
        else
                source_p->umodes |= DEFAULT_OPER_UMODES;
 
+       if(!EmptyString(ConfigFileEntry.default_operhost))
+       {
+               change_nick_user_host(source_p, source_p->name, source_p->username, ConfigFileEntry.default_operhost, 0, "Changing host");
+               
+               sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host (set by %s)", source_p->host, source_p->servptr->name);
+
+               sendto_server(NULL, NULL,
+                       CAP_EUID | CAP_TS6, NOCAPS, ":%s CHGHOST %s :%s",
+                       use_id(&me), use_id(source_p), source_p->host);
+               sendto_server(NULL, NULL,
+                       CAP_TS6, CAP_EUID, ":%s ENCAP * CHGHOST %s :%s",
+                       use_id(&me), use_id(source_p), source_p->host);
+
+               if (!IsDynSpoof(source_p))
+                       SetDynSpoof(source_p);
+       }
+
        if (oper_p->snomask)
        {
                source_p->snomask |= oper_p->snomask;
@@ -1464,6 +1487,13 @@ change_nick_user_host(struct Client *target_p,   const char *nick, const char *use
                        chptr = mscptr->chptr;
                        mptr = mode;
 
+                       if(is_owner(mscptr))
+                       {
+                               *mptr++ = 'a';
+                               strcat(modeval, nick);
+                               strcat(modeval, " ");
+                       }
+
                        if(is_chanop(mscptr))
                        {
                                *mptr++ = 'o';
@@ -1471,6 +1501,13 @@ change_nick_user_host(struct Client *target_p,   const char *nick, const char *use
                                strcat(modeval, " ");
                        }
 
+                       if(is_halfop(mscptr))
+                       {
+                               *mptr++ = 'h';
+                               strcat(modeval, nick);
+                               strcat(modeval, " ");
+                       }
+
                        if(is_voiced(mscptr))
                        {
                                *mptr++ = 'v';