X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/4cda5f2264cede6062de2fa859eec3c4ff91b52c..90a3c35b295b07ebe3793bf5d3b882c3c1a5dc7c:/modules/m_who.c diff --git a/modules/m_who.c b/modules/m_who.c index 2bec096..bb88259 100644 --- a/modules/m_who.c +++ b/modules/m_who.c @@ -21,10 +21,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_who.c 3283 2007-03-28 13:11:30Z jilles $ + * $Id: m_who.c 3350 2007-04-02 22:03:08Z jilles $ */ #include "stdinc.h" -#include "tools.h" #include "common.h" #include "client.h" #include "channel.h" @@ -51,7 +50,7 @@ struct Message who_msgtab = { }; mapi_clist_av1 who_clist[] = { &who_msgtab, NULL }; -DECLARE_MODULE_AV1(who, NULL, NULL, who_clist, NULL, NULL, "$Revision: 3283 $"); +DECLARE_MODULE_AV1(who, NULL, NULL, who_clist, NULL, NULL, "$Revision: 3350 $"); static void do_who_on_channel(struct Client *source_p, struct Channel *chptr, int server_oper, int member); @@ -75,7 +74,7 @@ m_who(struct Client *client_p, struct Client *source_p, int parc, const char *pa struct Client *target_p; struct membership *msptr; char *mask; - dlink_node *lp; + rb_dlink_node *lp; struct Channel *chptr = NULL; int server_oper = parc > 2 ? (*parv[2] == 'o') : 0; /* Show OPERS only */ int member; @@ -119,7 +118,7 @@ m_who(struct Client *client_p, struct Client *source_p, int parc, const char *pa if(IsChannelName(mask)) { /* List all users on a given channel */ - chptr = find_channel(parv[1]); + chptr = find_channel(parv[1] + operspy); if(chptr != NULL) { if(operspy) @@ -131,7 +130,7 @@ m_who(struct Client *client_p, struct Client *source_p, int parc, const char *pa do_who_on_channel(source_p, chptr, server_oper, NO); } sendto_one(source_p, form_str(RPL_ENDOFWHO), - me.name, source_p->name, parv[1]); + me.name, source_p->name, parv[1] + operspy); return 0; } @@ -143,7 +142,7 @@ m_who(struct Client *client_p, struct Client *source_p, int parc, const char *pa int isinvis = 0; isinvis = IsInvisible(target_p); - DLINK_FOREACH(lp, target_p->user->channel.head) + RB_DLINK_FOREACH(lp, target_p->user->channel.head) { msptr = lp->data; chptr = msptr->chptr; @@ -225,9 +224,9 @@ who_common_channel(struct Client *source_p, struct Channel *chptr, { struct membership *msptr; struct Client *target_p; - dlink_node *ptr; + rb_dlink_node *ptr; - DLINK_FOREACH(ptr, chptr->members.head) + RB_DLINK_FOREACH(ptr, chptr->members.head) { msptr = ptr->data; target_p = msptr->client_p; @@ -244,7 +243,7 @@ who_common_channel(struct Client *source_p, struct Channel *chptr, { if((mask == NULL) || match(mask, target_p->name) || match(mask, target_p->username) || - match(mask, target_p->host) || match(mask, target_p->user->server) || + match(mask, target_p->host) || match(mask, target_p->servptr->name) || (IsOper(source_p) && match(mask, target_p->orighost)) || match(mask, target_p->info)) { @@ -272,7 +271,7 @@ who_global(struct Client *source_p, const char *mask, int server_oper, int opers { struct membership *msptr; struct Client *target_p; - dlink_node *lp, *ptr; + rb_dlink_node *lp, *ptr; int maxmatches = 500; /* first, list all matching INvisible clients on common channels @@ -280,7 +279,7 @@ who_global(struct Client *source_p, const char *mask, int server_oper, int opers */ if(!operspy) { - DLINK_FOREACH(lp, source_p->user->channel.head) + RB_DLINK_FOREACH(lp, source_p->user->channel.head) { msptr = lp->data; who_common_channel(source_p, msptr->chptr, mask, server_oper, &maxmatches); @@ -294,7 +293,7 @@ who_global(struct Client *source_p, const char *mask, int server_oper, int opers * if this is an operspy who, list all matching clients, no need * to clear marks */ - DLINK_FOREACH(ptr, global_client_list.head) + RB_DLINK_FOREACH(ptr, global_client_list.head) { target_p = ptr->data; if(!IsPerson(target_p)) @@ -313,7 +312,7 @@ who_global(struct Client *source_p, const char *mask, int server_oper, int opers { if(!mask || match(mask, target_p->name) || match(mask, target_p->username) || - match(mask, target_p->host) || match(mask, target_p->user->server) || + match(mask, target_p->host) || match(mask, target_p->servptr->name) || (IsOper(source_p) && match(mask, target_p->orighost)) || match(mask, target_p->info)) { @@ -346,10 +345,10 @@ do_who_on_channel(struct Client *source_p, struct Channel *chptr, { struct Client *target_p; struct membership *msptr; - dlink_node *ptr; + rb_dlink_node *ptr; int combine = IsCapable(source_p, CLICAP_MULTI_PREFIX); - DLINK_FOREACH(ptr, chptr->members.head) + RB_DLINK_FOREACH(ptr, chptr->members.head) { msptr = ptr->data; target_p = msptr->client_p; @@ -379,13 +378,13 @@ do_who(struct Client *source_p, struct Client *target_p, const char *chname, con { char status[5]; - ircsprintf(status, "%c%s%s", + rb_sprintf(status, "%c%s%s", target_p->user->away ? 'G' : 'H', IsOper(target_p) ? "*" : "", op_flags); sendto_one(source_p, form_str(RPL_WHOREPLY), me.name, source_p->name, (chname) ? (chname) : "*", target_p->username, - target_p->host, target_p->user->server, target_p->name, + target_p->host, target_p->servptr->name, target_p->name, status, ConfigServerHide.flatten_links ? 0 : target_p->hopcount, target_p->info);