]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - extensions/m_okick.c
Add SHA256/SHA512 support to crypt.c and fix up the MD5 component (it seemed to have...
[irc/rqf/shadowircd.git] / extensions / m_okick.c
index 156a046e1e0d4672e919b56d6b3e31f0e7b9d070..bf1ea2cdd4448819ea15162caa755321807a35e8 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: m_okick.c 3554 2007-08-10 22:31:14Z jilles $
  */
 
 #include "stdinc.h"
 #include "channel.h"
 #include "client.h"
-#include "irc_string.h"
+#include "match.h"
 #include "ircd.h"
 #include "numeric.h"
 #include "send.h"
@@ -52,7 +51,6 @@ DECLARE_MODULE_AV1(okick, NULL, NULL, okick_clist, NULL, NULL, "$Revision: 3554
 
 /*
 ** m_okick
-**      parv[0] = sender prefix
 **      parv[1] = channel
 **      parv[2] = client to kick
 **      parv[3] = kick comment
@@ -69,11 +67,12 @@ mo_okick(struct Client *client_p, struct Client *source_p, int parc, const char
        char *name;
        char *p = NULL;
        char *user;
+       char text[10];
        static char buf[BUFSIZE];
 
        if(*parv[2] == '\0')
        {
-               sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "KICK");
+               sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "KICK");
                return 0;
        }
 
@@ -108,14 +107,14 @@ mo_okick(struct Client *client_p, struct Client *source_p, int parc, const char
 
        if((target_p = find_client(user)) == NULL)
        {
-               sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, parv[0], user);
+               sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, user);
                return 0;
        }
 
        if((msptr = find_channel_membership(chptr, target_p)) == NULL)
        {
                sendto_one(source_p, form_str(ERR_USERNOTINCHANNEL),
-                          me.name, parv[0], parv[1], parv[2]);
+                          me.name, source_p->name, parv[1], parv[2]);
                return 0;
        }
 
@@ -136,8 +135,12 @@ mo_okick(struct Client *client_p, struct Client *source_p, int parc, const char
                             me.name, chptr->chname, who->name, comment);
        sendto_server(&me, chptr, CAP_TS6, NOCAPS,
                      ":%s KICK %s %s :%s", me.id, chptr->chname, who->id, comment);
-       sendto_server(&me, chptr, NOCAPS, CAP_TS6,
-                     ":%s KICK %s %s :%s", me.name, chptr->chname, who->name, comment);
        remove_user_from_channel(msptr);
+
+       rb_snprintf(text, sizeof(text), "K%s", who->id);
+
+       /* we don't need to track NOREJOIN stuff unless it's our client being kicked */
+       if(MyClient(who) && chptr->mode.mode & MODE_NOREJOIN)
+               channel_metadata_time_add(chptr, text, rb_current_time(), "KICKNOREJOIN");
        return 0;
 }