Merge branch 'master' into KeepConn
authorpk910 <philipp@zoelle1.de>
Mon, 12 Nov 2012 00:20:49 +0000 (01:20 +0100)
committerpk910 <philipp@zoelle1.de>
Mon, 12 Nov 2012 00:20:49 +0000 (01:20 +0100)
Conflicts:
include/handlers.h
ircd/Makefile.in

1  2 
include/handlers.h
include/msg.h
include/numeric.h
ircd/Makefile.in
ircd/parse.c
ircd/s_err.c
ircd/s_user.c

diff --combined include/handlers.h
index 19b64ceb1d8adab8b81701c8d3b5ef471279cdd3,2cb2954543122501df4c1378594e18cfc161688a..79a052d913e9be4b63bbe11170f91d030e83ac31
@@@ -125,7 -125,6 +125,7 @@@ extern int m_privs(struct Client*, stru
  extern int m_proto(struct Client*, struct Client*, int, char*[]);
  extern int m_pseudo(struct Client*, struct Client*, int, char*[]);
  extern int m_quit(struct Client*, struct Client*, int, char*[]);
 +extern int m_recover(struct Client*, struct Client*, int, char*[]);
  extern int m_registered(struct Client*, struct Client*, int, char*[]);
  extern int m_silence(struct Client*, struct Client*, int, char*[]);
  extern int m_stats(struct Client*, struct Client*, int, char*[]);
@@@ -135,6 -134,7 +135,7 @@@ extern int m_svsjoin(struct Client*, st
  extern int m_time(struct Client*, struct Client*, int, char*[]);
  extern int m_topic(struct Client*, struct Client*, int, char*[]);
  extern int m_trace(struct Client*, struct Client*, int, char*[]);
+ extern int m_uninvite(struct Client*, struct Client*, int, char*[]);
  extern int m_unregistered(struct Client*, struct Client*, int, char*[]);
  extern int m_unsupported(struct Client*, struct Client*, int, char*[]);
  extern int m_user(struct Client*, struct Client*, int, char*[]);
@@@ -236,7 -236,7 +237,8 @@@ extern int ms_svsjoin(struct Client*, s
  extern int ms_svspart(struct Client*, struct Client*, int, char*[]);
  extern int ms_topic(struct Client*, struct Client*, int, char*[]);
  extern int ms_trace(struct Client*, struct Client*, int, char*[]);
 +extern int ms_unzombie(struct Client*, struct Client*, int, char*[]);
+ extern int ms_uninvite(struct Client*, struct Client*, int, char*[]);
  extern int ms_uping(struct Client*, struct Client*, int, char*[]);
  extern int ms_version(struct Client*, struct Client*, int, char*[]);
  extern int ms_wallchops(struct Client*, struct Client*, int, char*[]);
@@@ -244,7 -244,6 +246,7 @@@ extern int ms_wallops(struct Client*, s
  extern int ms_wallusers(struct Client*, struct Client*, int, char*[]);
  extern int ms_wallvoices(struct Client*, struct Client*, int, char*[]);
  extern int ms_whois(struct Client*, struct Client*, int, char*[]);
 +extern int ms_zombie(struct Client*, struct Client*, int, char*[]);
  
  #endif /* INCLUDED_handlers_h */
  
diff --combined include/msg.h
index 4afde55c7ee02a2babee5679359acc57b447f622,e5ed3405c588f507eba8612efc2f821fb1199a55..f6151105ce11bfda46b944afc34bd1c362f503f5
@@@ -88,6 -88,10 +88,10 @@@ struct Client
  #define TOK_INVITE              "I"
  #define CMD_INVITE            MSG_INVITE, TOK_INVITE
  
+ #define MSG_UNINVITE            "UNINVITE"        /* INVI */
+ #define TOK_UNINVITE            "UI"
+ #define CMD_UNINVITE  MSG_UNINVITE, TOK_UNINVITE
  #define MSG_VERSION             "VERSION"       /* VERS */
  #define TOK_VERSION             "V"
  #define CMD_VERSION           MSG_VERSION, TOK_VERSION
  #define TOK_ACCOUNT           "AC"
  #define CMD_ACCOUNT           MSG_ACCOUNT, TOK_ACCOUNT
  
 +#define MSG_RECOVER           "RECOVER"       /* RECOVER */
 +#define TOK_RECOVER           "RC"
 +#define CMD_RECOVER           MSG_RECOVER, TOK_RECOVER
 +
 +#define MSG_ZOMBIE            "ZOMBIE"        /* ZOMB */
 +#define TOK_ZOMBIE            "ZO"
 +#define CMD_ZOMBIE            MSG_ZOMBIE, TOK_ZOMBIE
 +
 +#define MSG_UNZOMBIE          "UNZOMBIE"      /* UZMB */
 +#define TOK_UNZOMBIE          "ZU"
 +#define CMD_UNZOMBIE          MSG_UNZOMBIE, TOK_UNZOMBIE
 +
  #define MSG_ASLL               "ASLL"          /* ASLL */
  #define TOK_ASLL               "LL"
  #define CMD_ASLL               MSG_ASLL, TOK_ASLL
diff --combined include/numeric.h
index 6de836346df470b0c6f6c2a3a1dd463ea5886f6d,1d8e372f79611ff5e4fec1fe4e3b107776df55dc..d979e5fc7266ece7ed7d2b9d181aa2db6b6275b5
@@@ -264,12 -264,13 +264,13 @@@ extern const struct Numeric* get_error_
  #define RPL_USERIP           340        /* Undernet extension */
  #define RPL_INVITING         341
  /*      RPL_SUMMONING        342           removed from RFC1459 */
+ #define RPL_UNINVITE         343
  
  #define RPL_ISSUEDINVITE     345        /* Undernet extension */
  #define RPL_INVITELIST       346        /* IRCnet, Undernet extension */
  #define RPL_ENDOFINVITELIST  347        /* IRCnet, Undernet extension */
/*      RPL_EXCEPTLIST       348           IRCnet extension */
/*      RPL_ENDOFEXCEPTLIST  349           IRCnet extension */
#define RPL_EXCEPTLIST       348        /* IRCnet extension */
#define RPL_ENDOFEXCEPTLIST  349        /* IRCnet extension */
  
  #define RPL_VERSION          351
  #define RPL_WHOREPLY         352        /* See also RPL_ENDOFWHO */
  #define ERR_NONICKNAMEGIVEN  431
  #define ERR_ERRONEUSNICKNAME 432
  #define ERR_NICKNAMEINUSE    433
 +#define ERR_RECOVERDENIED    434
  /*      ERR_SERVICENAMEINUSE 434 ? */
  /*    ERR_NORULES          434   unreal */
  /*      ERR_SERVICECONFUSED  435 ? */
  /*      ERR_SUMMONDISABLED   445           removed from RFC1459 */
  /*      ERR_USERSDISABLED    446           removed from RFC1459 */
  /*    ERR_NONICKCHANGE     447         unreal */
+ #define ERR_USERNOTINVITED    448
  
  #define ERR_NOTREGISTERED    451
  /*      ERR_IDCOLLISION      452           IRCnet extension ? */
diff --combined ircd/Makefile.in
index c3361889b420c1336be6d78935c9f45baba34910,d007a8c1f3e3fccda42d65744f25bba07b96f559..c9057a28a12fc2129d9b1443546b05a7d66df13a
@@@ -160,8 -160,7 +160,8 @@@ IRCD_SRC = 
        m_proto.c \
        m_pseudo.c \
        m_quit.c \
 -      m_rehash.c \
 +      m_recover.c \
 +    m_rehash.c \
        m_relay.c \
        m_reset.c \
        m_restart.c \
        m_time.c \
        m_topic.c \
        m_trace.c \
 +      m_unzombie.c \
+       m_uninvite.c \
        m_uping.c \
        m_user.c \
        m_userhost.c \
        m_who.c \
        m_whois.c \
        m_whowas.c \
 +      m_zombie.c \
        match.c \
        memdebug.c \
        motd.c \
diff --combined ircd/parse.c
index c8a032216377a63e722bea1184362836be6cf844,fab27434241d81c99a34abd5a4773ae7d1fb6993..519049c328a9969b9da6a5c146195809ad82e669
@@@ -218,6 -218,13 +218,13 @@@ struct Message msgtab[] = 
      /* UNREG, CLIENT, SERVER, OPER, SERVICE */
      { m_unregistered, m_invite, ms_invite, m_invite, m_ignore }
    },
+   {
+     MSG_UNINVITE,
+     TOK_UNINVITE,
+     0, MAXPARA, MFLG_SLOW, 0, NULL,
+     /* UNREG, CLIENT, SERVER, OPER, SERVICE */
+     { m_unregistered, m_uninvite, ms_uninvite, m_uninvite, m_ignore }
+   },
    {
      MSG_KICK,
      TOK_KICK,
      /* UNREG, CLIENT, SERVER, OPER, SERVICE */
      { m_ignore, m_ignore, ms_account, m_ignore, m_ignore }
    },
 +  {
 +    MSG_RECOVER,
 +    TOK_RECOVER,
 +    0, MAXPARA, MFLG_SLOW, 0, NULL,
 +    /* UNREG, CLIENT, SERVER, OPER, SERVICE */
 +    { m_unregistered, m_recover, m_ignore, m_recover, m_ignore }
 +  },
 +  {
 +    MSG_ZOMBIE,
 +    TOK_ZOMBIE,
 +    0, MAXPARA, MFLG_SLOW, 0, NULL,
 +    /* UNREG, CLIENT, SERVER, OPER, SERVICE */
 +    { m_ignore, m_ignore, ms_zombie, m_ignore, m_ignore }
 +  },
 +  {
 +    MSG_UNZOMBIE,
 +    TOK_UNZOMBIE,
 +    0, MAXPARA, MFLG_SLOW, 0, NULL,
 +    /* UNREG, CLIENT, SERVER, OPER, SERVICE */
 +    { m_ignore, m_ignore, ms_unzombie, m_ignore, m_ignore }
 +  },
    {
      MSG_ASLL,
      TOK_ASLL,
diff --combined ircd/s_err.c
index bc7d0ffbd4347d677789b550fc1aa3ccc3d53537,1a31ebf5fdeb4f40ef4c7681e64c089e2c44cf70..c8a3e58c2434255f470606fb24d0ec172996c647
@@@ -718,7 -718,7 +718,7 @@@ static Numeric replyTable[] = 
  /* 342 */
    { 0 },
  /* 343 */
-   { 0 },
+   { RPL_UNINVITE, "%s %s", "343" },
  /* 344 */
    { 0 },
  /* 345 */
  /* 347 */
    { RPL_ENDOFINVITELIST, ":End of Invite List", "347" },
  /* 348 */
-   { 0 },
+   { RPL_EXCEPTLIST, "%s %s %s %Tu", "348" },
  /* 349 */
-   { 0 },
+   { RPL_ENDOFEXCEPTLIST, "%s :End of Channel Exception List", "349" },
  /* 350 */
    { 0 },
  /* 351 */
  /* 433 */
    { ERR_NICKNAMEINUSE, "%s :Nickname is already in use.", "433" },
  /* 434 */
 -  { 0 },
 +  { ERR_RECOVERDENIED, "%s :You may not recover this connection. (%s)", "434" },
  /* 435 */
    { 0 },
  /* 436 */
  /* 447 */
    { 0 },
  /* 448 */
-   { 0 },
+   { ERR_USERNOTINVITED, "%s %s :is not invited to channel", "448" },
  /* 449 */
    { 0 },
  /* 450 */
diff --combined ircd/s_user.c
index f42cf9a0130438611eb59540029820c7ee176904,9f45018041e994d00f334dcf0687ff8283baa4d5..2c9a9bce35be8aeaa46866eab9ef0925ba10f38e
@@@ -589,8 -589,7 +589,8 @@@ static const struct UserMode 
    { FLAG_WEBIRC,      'W' },
    { FLAG_SEE_IDLETIME,'t' },
    { FLAG_SECURITY_SERV,'D' },
 -  { FLAG_HIDDENHOST,  'x' }
 +  { FLAG_HIDDENHOST,  'x' },
 +  { FLAG_NOTCONN,     'Z' }
  };
  
  /** Length of #userModeList. */
@@@ -1070,6 -1069,25 +1070,25 @@@ hide_hostmask(struct Client *cptr, unsi
      else {
          SetDelayedJoin(chan);
      }
+     
+     /*
+     * Check if the client is actually overriding a ban with the
+     * mask change, if so, kick him out of the channel.
+     * We have to proceed that way to ensure data consistency (join + kick)
+     */
+     if (find_ban(cptr, chan->channel->banlist)) {
+       /* Silentely kick in case of delayed join */
+       if (chan->channel->mode.mode & MODE_DELJOINS) {
+         sendcmdto_one(&his, CMD_KICK, cptr, "%H %C :Ban override", chan->channel, cptr);
+         CheckDelayedJoins(chan->channel);
+         
+       } else {
+         /* Otherwise publicly kick */
+         sendcmdto_serv_butone(&me, CMD_KICK, NULL, "%H %C :Ban override", chan->channel, cptr);
+         sendcmdto_channel_butserv_butone(&his, CMD_KICK, chan->channel, NULL, 0, "%H %C :Ban override", chan->channel, cptr);
+         make_zombie(chan, cptr, &me, &me, chan->channel);
+       }
+     }
    }
    return 0;
  }
@@@ -1300,12 -1318,6 +1319,12 @@@ int set_user_mode(struct Client *cptr, 
        case 'z': /* Formerly SSL mode; we ignore it. */
          break;
  #endif
 +      case 'Z':
 +        if (what == MODE_ADD)
 +          SetNotConn(sptr);
 +        else
 +          ClearNotConn(sptr);
 +        break;
        default:
          send_reply(sptr, ERR_UMODEUNKNOWNFLAG, *m);
          break;
        ClrFlag(sptr, FLAG_FAKEHOST);
      if (!FlagHas(&setflags, FLAG_SEE_IDLETIME) && IsSeeIdletime(sptr))
        ClrFlag(sptr, FLAG_SEE_IDLETIME);
 +    if (!FlagHas(&setflags, FLAG_NOTCONN) && IsNotConn(sptr))
 +      ClrFlag(sptr, FLAG_NOTCONN);
      /*
       * new umode; servers and privileged opers can set it, local users cannot;
       * prevents users from /kick'ing or /mode -o'ing