#include "packet.h"
#include "s_newconf.h"
-static int m_mode(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int ms_mode(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int ms_tmode(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int ms_mlock(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int ms_bmask(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static const char mode_desc[] =
+ "Provides the MODE and MLOCK client and server commands, and TS6 server-to-server TMODE and BMASK commands";
+
+static void m_mode(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void ms_mode(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void ms_tmode(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void ms_mlock(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void ms_bmask(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
struct Message mode_msgtab = {
"MODE", 0, 0, 0, 0,
};
mapi_clist_av1 mode_clist[] = { &mode_msgtab, &tmode_msgtab, &mlock_msgtab, &bmask_msgtab, NULL };
-static const char mode_desc[] =
- "Provides the MODE and MLOCK client and server commands, and TS6 server-to-server TMODE and BMASK commands";
DECLARE_MODULE_AV2(mode, NULL, NULL, mode_clist, NULL, NULL, NULL, NULL, mode_desc);
* m_mode - MODE command handler
* parv[1] - channel
*/
-static int
+static void
m_mode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct Channel *chptr = NULL;
{
sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS),
me.name, source_p->name, "MODE");
- return 0;
+ return;
}
}
{
/* if here, it has to be a non-channel name */
user_mode(client_p, source_p, parc, parv);
- return 0;
+ return;
}
if(!check_channel_name(dest))
{
sendto_one_numeric(source_p, ERR_BADCHANNAME, form_str(ERR_BADCHANNAME), parv[1]);
- return 0;
+ return;
}
chptr = find_channel(dest);
{
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
form_str(ERR_NOSUCHCHANNEL), parv[1]);
- return 0;
+ return;
}
/* Now know the channel exists */
set_channel_mode(client_p, source_p, chptr, msptr, parc - n, parv + n);
}
-
- return 0;
}
-static int
+static void
ms_mode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct Channel *chptr;
{
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
form_str(ERR_NOSUCHCHANNEL), parv[1]);
- return 0;
+ return;
}
set_channel_mode(client_p, source_p, chptr, NULL, parc - 2, parv + 2);
-
- return 0;
}
-static int
+static void
ms_tmode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct Channel *chptr = NULL;
if(!IsChanPrefix(parv[2][0]) || !check_channel_name(parv[2]))
{
sendto_one_numeric(source_p, ERR_BADCHANNAME, form_str(ERR_BADCHANNAME), parv[2]);
- return 0;
+ return;
}
chptr = find_channel(parv[2]);
{
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
form_str(ERR_NOSUCHCHANNEL), parv[2]);
- return 0;
+ return;
}
/* TS is higher, drop it. */
if(atol(parv[1]) > chptr->channelts)
- return 0;
+ return;
if(IsServer(source_p))
{
set_channel_mode(client_p, source_p, chptr, msptr, parc - 3, parv + 3);
}
-
- return 0;
}
-static int
+static void
ms_mlock(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct Channel *chptr = NULL;
if(!IsChanPrefix(parv[2][0]) || !check_channel_name(parv[2]))
{
sendto_one_numeric(source_p, ERR_BADCHANNAME, form_str(ERR_BADCHANNAME), parv[2]);
- return 0;
+ return;
}
chptr = find_channel(parv[2]);
{
sendto_one_numeric(source_p, ERR_NOSUCHCHANNEL,
form_str(ERR_NOSUCHCHANNEL), parv[2]);
- return 0;
+ return;
}
/* TS is higher, drop it. */
if(atol(parv[1]) > chptr->channelts)
- return 0;
+ return;
if(IsServer(source_p))
- set_channel_mlock(client_p, source_p, chptr, parv[3], TRUE);
-
- return 0;
+ set_channel_mlock(client_p, source_p, chptr, parv[3], true);
}
static void
(actualBan->forward == NULL ||
irccmp(actualBan->forward, forward) < 0))
{
- sendto_channel_local(mems, chptr, ":%s MODE %s -%c %s%s%s",
+ sendto_channel_local(fakesource_p, mems, chptr, ":%s MODE %s -%c %s%s%s",
fakesource_p->name,
chptr->chname,
mchar,
}
}
-static int
+static void
ms_bmask(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
static char modebuf[BUFSIZE];
struct Client *fakesource_p;
if(!IsChanPrefix(parv[2][0]) || !check_channel_name(parv[2]))
- return 0;
+ return;
if((chptr = find_channel(parv[2])) == NULL)
- return 0;
+ return;
/* TS is higher, drop it. */
if(atol(parv[1]) > chptr->channelts)
- return 0;
+ return;
switch (parv[3][0])
{
/* maybe we should just blindly propagate this? */
default:
- return 0;
+ return;
}
parabuf[0] = '\0';
{
*mbuf = '\0';
*(pbuf - 1) = '\0';
- sendto_channel_local(mems, chptr, "%s %s", modebuf, parabuf);
+ sendto_channel_local(fakesource_p, mems, chptr, "%s %s", modebuf, parabuf);
mbuf = modebuf + mlen;
pbuf = parabuf;
{
*mbuf = '\0';
*(pbuf - 1) = '\0';
- sendto_channel_local(mems, chptr, "%s %s", modebuf, parabuf);
+ sendto_channel_local(fakesource_p, mems, chptr, "%s %s", modebuf, parabuf);
}
sendto_server(client_p, chptr, CAP_TS6 | needcap, NOCAPS, ":%s BMASK %ld %s %s :%s",
source_p->id, (long) chptr->channelts, chptr->chname, parv[3], parv[4]);
- return 0;
}