]> jfr.im git - solanum.git/blobdiff - modules/m_names.c
buildsystem: honor $DESTDIR in install-data-hook
[solanum.git] / modules / m_names.c
index e307ab9745f79b56fc717627fc06c123380b6799..ad23284af709499d5159032323badbe0bed79679 100644 (file)
  */
 
 #include "stdinc.h"
-#include "sprintf_irc.h"
-#include "tools.h"
 #include "channel.h"
 #include "client.h"
 #include "common.h"
 #include "hash.h"
-#include "irc_string.h"
+#include "match.h"
 #include "ircd.h"
 #include "numeric.h"
 #include "send.h"
 #include "parse.h"
 #include "modules.h"
 
-static int m_names(struct Client *, struct Client *, int, const char **);
+static int m_names(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 
 struct Message names_msgtab = {
-       "NAMES", 0, 0, 0, MFLG_SLOW,
+       "NAMES", 0, 0, 0, 0,
        {mg_unreg, {m_names, 0}, mg_ignore, mg_ignore, mg_ignore, {m_names, 0}}
 };
 
@@ -59,11 +57,10 @@ static void names_global(struct Client *source_p);
 
 /*
  * m_names
- *      parv[0] = sender prefix
  *      parv[1] = channel
  */
 static int
-m_names(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+m_names(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        static time_t last_used = 0;
        struct Channel *chptr = NULL;
@@ -86,14 +83,14 @@ m_names(struct Client *client_p, struct Client *source_p, int parc, const char *
                if((chptr = find_channel(p)) != NULL)
                        channel_member_names(chptr, source_p, 1);
                else
-                       sendto_one(source_p, form_str(RPL_ENDOFNAMES), 
+                       sendto_one(source_p, form_str(RPL_ENDOFNAMES),
                                   me.name, source_p->name, p);
        }
        else
        {
                if(!IsOper(source_p))
                {
-                       if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
+                       if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
                        {
                                sendto_one(source_p, form_str(RPL_LOAD2HI),
                                           me.name, source_p->name, "NAMES");
@@ -102,11 +99,11 @@ m_names(struct Client *client_p, struct Client *source_p, int parc, const char *
                                return 0;
                        }
                        else
-                               last_used = CurrentTime;
+                               last_used = rb_current_time();
                }
 
                names_global(source_p);
-               sendto_one(source_p, form_str(RPL_ENDOFNAMES), 
+               sendto_one(source_p, form_str(RPL_ENDOFNAMES),
                           me.name, source_p->name, "*");
        }
 
@@ -127,7 +124,7 @@ names_global(struct Client *source_p)
        int tlen;
        int cur_len;
        int dont_show = NO;
-       dlink_node *lp, *ptr;
+       rb_dlink_node *lp, *ptr;
        struct Client *target_p;
        struct Channel *chptr = NULL;
        struct membership *msptr;
@@ -135,17 +132,17 @@ names_global(struct Client *source_p)
        char *t;
 
        /* first do all visible channels */
-       DLINK_FOREACH(ptr, global_channel_list.head)
+       RB_DLINK_FOREACH(ptr, global_channel_list.head)
        {
                chptr = ptr->data;
                channel_member_names(chptr, source_p, 0);
        }
-       cur_len = mlen = ircsprintf(buf, form_str(RPL_NAMREPLY), 
+       cur_len = mlen = sprintf(buf, form_str(RPL_NAMREPLY),
                                    me.name, source_p->name, "*", "*");
        t = buf + mlen;
 
        /* Second, do all clients in one big sweep */
-       DLINK_FOREACH(ptr, global_client_list.head)
+       RB_DLINK_FOREACH(ptr, global_client_list.head)
        {
                target_p = ptr->data;
                dont_show = NO;
@@ -160,7 +157,7 @@ names_global(struct Client *source_p)
                 * both were missed out above.  if the target is on a
                 * common channel with source, its already been shown.
                 */
-               DLINK_FOREACH(lp, target_p->user->channel.head)
+               RB_DLINK_FOREACH(lp, target_p->user->channel.head)
                {
                        msptr = lp->data;
                        chptr = msptr->chptr;
@@ -183,7 +180,7 @@ names_global(struct Client *source_p)
                        t = buf + mlen;
                }
 
-               tlen = ircsprintf(t, "%s ", target_p->name);
+               tlen = sprintf(t, "%s ", target_p->name);
                cur_len += tlen;
                t += tlen;
        }