X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/212380e3f42f585dc1ea927402252eb943f91f7b..d09c55338feb5627da978058432a15dccec16907:/extensions/m_findforwards.c?ds=sidebyside diff --git a/extensions/m_findforwards.c b/extensions/m_findforwards.c index 488c610f..422197bf 100644 --- a/extensions/m_findforwards.c +++ b/extensions/m_findforwards.c @@ -16,15 +16,12 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * $Id: m_findforwards.c 986 2006-03-08 00:10:46Z jilles $ */ #include "stdinc.h" -#include "tools.h" #include "channel.h" #include "client.h" #include "hash.h" -#include "irc_string.h" +#include "match.h" #include "ircd.h" #include "numeric.h" #include "s_user.h" @@ -35,31 +32,33 @@ #include "parse.h" #include "modules.h" #include "packet.h" +#include "messages.h" + +static const char findfowards_desc[] = "Allows operators to find forwards to a given channel"; -static int m_findforwards(struct Client *client_p, struct Client *source_p, +static void m_findforwards(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]); struct Message findforwards_msgtab = { - "FINDFORWARDS", 0, 0, 0, MFLG_SLOW, + "FINDFORWARDS", 0, 0, 0, 0, {mg_unreg, {m_findforwards, 2}, mg_ignore, mg_ignore, mg_ignore, {m_findforwards, 2}} }; mapi_clist_av1 findforwards_clist[] = { &findforwards_msgtab, NULL }; -DECLARE_MODULE_AV1(findforwards, NULL, NULL, findforwards_clist, NULL, NULL, "$Revision: 986 $"); +DECLARE_MODULE_AV2(findforwards, NULL, NULL, findforwards_clist, NULL, NULL, NULL, NULL, findfowards_desc); /* ** mo_findforwards -** parv[0] = sender prefix ** parv[1] = channel */ -static int -m_findforwards(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) +static void +m_findforwards(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; struct membership *msptr; - dlink_node *ptr; + rb_dlink_node *ptr; char buf[414]; char *p = buf, *end = buf + sizeof buf - 1; *p = '\0'; @@ -71,30 +70,30 @@ m_findforwards(struct Client *client_p, struct Client *source_p, int parc, const { sendto_one_numeric(source_p, ERR_NOTONCHANNEL, form_str(ERR_NOTONCHANNEL), parv[1]); - return 0; + return; } if(!is_chanop(msptr)) { sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), me.name, source_p->name, parv[1]); - return 0; + return; } - 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, "FINDFORWARDS"); - return 0; + return; } else - last_used = CurrentTime; + last_used = rb_current_time(); } - - DLINK_FOREACH(ptr, global_channel_list.head) + + RB_DLINK_FOREACH(ptr, global_channel_list.head) { chptr = ptr->data; - if(chptr->mode.forward && !irccmp(chptr->mode.forward, parv[1])) + if(!irccmp(chptr->mode.forward, parv[1])) { if(p + strlen(chptr->chname) >= end - 13) { @@ -112,6 +111,4 @@ m_findforwards(struct Client *client_p, struct Client *source_p, int parc, const *(--p) = '\0'; sendto_one_notice(source_p, ":Forwards for %s: %s", parv[1], buf); - - return 0; }