X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/853b68f7d011941901bc792a996a6a65eb9cd7d3..7baa37a9ef4c66708d7505dfda182339461232cf:/extensions/m_omode.c diff --git a/extensions/m_omode.c b/extensions/m_omode.c index 3c33f167..3fd9ce52 100644 --- a/extensions/m_omode.c +++ b/extensions/m_omode.c @@ -29,7 +29,7 @@ #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" @@ -41,11 +41,13 @@ #include "parse.h" #include "modules.h" #include "packet.h" +#include "messages.h" +#include "logger.h" -static int mo_omode(struct Client *, struct Client *, int, const char **); +static int mo_omode(struct MsgBuf *, struct Client *, struct Client *, int, const char **); struct Message omode_msgtab = { - "OMODE", 0, 0, 0, MFLG_SLOW, + "OMODE", 0, 0, 0, 0, {mg_unreg, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_omode, 3}} }; @@ -55,11 +57,10 @@ DECLARE_MODULE_AV1(omode, NULL, NULL, omode_clist, NULL, NULL, "$Revision: 3121 /* * mo_omode - MODE command handler - * parv[0] - sender * parv[1] - channel */ static int -mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) +mo_omode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { struct Channel *chptr = NULL; struct membership *msptr; @@ -105,24 +106,24 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char for (i = 2; i < parc; i++) { if (i != 2) - strlcat(params, " ", sizeof params); - strlcat(params, parv[i], sizeof params); + rb_strlcat(params, " ", sizeof params); + rb_strlcat(params, parv[i], sizeof params); } - sendto_wallops_flags(UMODE_WALLOP, &me, + sendto_wallops_flags(UMODE_WALLOP, &me, "OMODE called for [%s] [%s] by %s!%s@%s", parv[1], params, source_p->name, source_p->username, source_p->host); ilog(L_MAIN, "OMODE called for [%s] [%s] by %s", parv[1], params, get_oper_name(source_p)); if(*chptr->chname != '&') - sendto_server(NULL, NULL, NOCAPS, NOCAPS, + sendto_server(NULL, NULL, NOCAPS, NOCAPS, ":%s WALLOPS :OMODE called for [%s] [%s] by %s!%s@%s", me.name, parv[1], params, source_p->name, source_p->username, source_p->host); #if 0 - set_channel_mode(client_p, source_p->servptr, chptr, msptr, + set_channel_mode(client_p, source_p->servptr, chptr, msptr, parc - 2, parv + 2); #else if (parc == 4 && !strcmp(parv[2], "+o") && !irccmp(parv[3], source_p->name)) @@ -140,9 +141,6 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char ":%s TMODE %ld %s +o %s", me.id, (long) chptr->channelts, parv[1], source_p->id); - sendto_server(NULL, chptr, NOCAPS, CAP_TS6, - ":%s MODE %s +o %s", - me.name, parv[1], source_p->name); msptr->flags |= CHFL_CHANOP; } else @@ -155,7 +153,7 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char add_user_to_channel(chptr, source_p, CHFL_CHANOP); msptr = find_channel_membership(chptr, source_p); } - set_channel_mode(client_p, source_p, chptr, msptr, + set_channel_mode(client_p, source_p, chptr, msptr, parc - 2, parv + 2); /* We know they were not opped before and they can't have opped * themselves as set_channel_mode() does not allow that