X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/551241607041c874f24f5be43d0aa3210740ed08..742ddc8fac87a5dd713110df6f2a76f56d34b00b:/modules/m_names.c diff --git a/modules/m_names.c b/modules/m_names.c index 315d5207..026dfd2d 100644 --- a/modules/m_names.c +++ b/modules/m_names.c @@ -20,14 +20,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id: m_names.c 254 2005-09-21 23:35:12Z nenolod $ */ #include "stdinc.h" #include "channel.h" #include "client.h" -#include "common.h" #include "hash.h" #include "match.h" #include "ircd.h" @@ -39,15 +36,18 @@ #include "parse.h" #include "modules.h" -static int m_names(struct Client *, struct Client *, int, const char **); +static const char names_desc[] = "Provides the NAMES command to view users on a channel"; + +static void 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}} }; mapi_clist_av1 names_clist[] = { &names_msgtab, NULL }; -DECLARE_MODULE_AV1(names, NULL, NULL, names_clist, NULL, NULL, "$Revision: 254 $"); + +DECLARE_MODULE_AV2(names, NULL, NULL, names_clist, NULL, NULL, NULL, NULL, names_desc); static void names_global(struct Client *source_p); @@ -59,8 +59,8 @@ static void names_global(struct Client *source_p); * m_names * parv[1] = channel */ -static int -m_names(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) +static void +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; @@ -77,7 +77,7 @@ m_names(struct Client *client_p, struct Client *source_p, int parc, const char * sendto_one_numeric(source_p, ERR_BADCHANNAME, form_str(ERR_BADCHANNAME), (unsigned char *) p); - return 0; + return; } if((chptr = find_channel(p)) != NULL) @@ -96,7 +96,7 @@ m_names(struct Client *client_p, struct Client *source_p, int parc, const char * me.name, source_p->name, "NAMES"); sendto_one(source_p, form_str(RPL_ENDOFNAMES), me.name, source_p->name, "*"); - return 0; + return; } else last_used = rb_current_time(); @@ -106,8 +106,6 @@ m_names(struct Client *client_p, struct Client *source_p, int parc, const char * sendto_one(source_p, form_str(RPL_ENDOFNAMES), me.name, source_p->name, "*"); } - - return 0; } /* @@ -123,7 +121,7 @@ names_global(struct Client *source_p) int mlen; int tlen; int cur_len; - int dont_show = NO; + bool dont_show = false; rb_dlink_node *lp, *ptr; struct Client *target_p; struct Channel *chptr = NULL; @@ -145,7 +143,7 @@ names_global(struct Client *source_p) RB_DLINK_FOREACH(ptr, global_client_list.head) { target_p = ptr->data; - dont_show = NO; + dont_show = false; if(!IsPerson(target_p) || IsInvisible(target_p)) continue; @@ -165,7 +163,7 @@ names_global(struct Client *source_p) if(PubChannel(chptr) || IsMember(source_p, chptr) || SecretChannel(chptr)) { - dont_show = YES; + dont_show = true; break; } }