X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/cbeab4bc340b7b3f4fbf424ff327758defb9598a..d295a3986d7bb97c3b36facb1c1d94cbc35d50a5:/extensions/m_omode.c diff --git a/extensions/m_omode.c b/extensions/m_omode.c index aed728a2..04524898 100644 --- a/extensions/m_omode.c +++ b/extensions/m_omode.c @@ -1,5 +1,5 @@ /* - * Charybdis: an advanced Internet Relay Chat Daemon(ircd). + * Solanum: a slightly advanced ircd * m_omode.c: allows oper mode hacking * * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center @@ -42,7 +42,9 @@ #include "messages.h" #include "logger.h" -static int mo_omode(struct MsgBuf *, struct Client *, struct Client *, int, const char **); +static const char omode_desc[] = "Allow admins to forcibly change modes on channels with the OMODE command"; + +static void mo_omode(struct MsgBuf *, struct Client *, struct Client *, int, const char **); struct Message omode_msgtab = { "OMODE", 0, 0, 0, 0, @@ -51,13 +53,13 @@ struct Message omode_msgtab = { mapi_clist_av1 omode_clist[] = { &omode_msgtab, NULL }; -DECLARE_MODULE_AV1(omode, NULL, NULL, omode_clist, NULL, NULL, "$Revision: 3121 $"); +DECLARE_MODULE_AV2(omode, NULL, NULL, omode_clist, NULL, NULL, NULL, NULL, omode_desc); /* * mo_omode - MODE command handler * parv[1] - channel */ -static int +static void mo_omode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { struct Channel *chptr = NULL; @@ -70,7 +72,7 @@ mo_omode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source if(!IsOperAdmin(source_p)) { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "admin"); - return 0; + return; } /* Now, try to find the channel in question */ @@ -78,7 +80,7 @@ mo_omode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source { sendto_one_numeric(source_p, ERR_BADCHANNAME, form_str(ERR_BADCHANNAME), parv[1]); - return 0; + return; } chptr = find_channel(parv[1]); @@ -87,7 +89,7 @@ mo_omode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source { sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL, form_str(ERR_NOSUCHCHANNEL), parv[1]); - return 0; + return; } /* Now know the channel exists */ @@ -97,7 +99,7 @@ mo_omode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source if (is_chanop(msptr)) { sendto_one_notice(source_p, ":Use a normal MODE you idiot"); - return 0; + return; } params[0] = '\0'; @@ -131,9 +133,9 @@ mo_omode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source { sendto_one_numeric(source_p, ERR_USERNOTINCHANNEL, form_str(ERR_USERNOTINCHANNEL), parv[3], chptr->chname); - return 0; + return; } - sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +o %s", + sendto_channel_local(&me, ALL_MEMBERS, chptr, ":%s MODE %s +o %s", me.name, parv[1], source_p->name); sendto_server(NULL, chptr, CAP_TS6, NOCAPS, ":%s TMODE %ld %s +o %s", @@ -162,5 +164,4 @@ mo_omode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source remove_user_from_channel(msptr); } #endif - return 0; }