Message handlers should return void.
Also fix up some return values and stuff to use bool (or void if nothing). I just did it whilst I was here. According to jilles, the return value used to signify whether or not the client had exited. This was error-prone and was fixed a long, long time ago, but the return value was left int for historical reasons. Since the return type is not used (and has no clear use case anyway), it's safe to just get rid of it.
This commit is contained in:
parent
eeabf33a7c
commit
3c7d6fcce7
99 changed files with 1339 additions and 1691 deletions
|
@ -40,8 +40,8 @@
|
|||
static const char adminwall_desc[] =
|
||||
"Provides the ADMINWALL command to send a message to all administrators";
|
||||
|
||||
static int mo_adminwall(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
static int me_adminwall(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
static void mo_adminwall(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
static void me_adminwall(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
|
||||
|
||||
struct Message adminwall_msgtab = {
|
||||
"ADMINWALL", 0, 0, 0, 0,
|
||||
|
@ -57,23 +57,21 @@ DECLARE_MODULE_AV2(adminwall, NULL, NULL, adminwall_clist, NULL, NULL, NULL, NUL
|
|||
* parv[1] = message text
|
||||
*/
|
||||
|
||||
static int
|
||||
static void
|
||||
mo_adminwall(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
if(!IsAdmin(source_p))
|
||||
{
|
||||
sendto_one(source_p, form_str(ERR_NOPRIVS),
|
||||
me.name, source_p->name, "adminwall");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
sendto_wallops_flags(UMODE_ADMIN, source_p, "ADMINWALL - %s", parv[1]);
|
||||
sendto_match_servs(source_p, "*", CAP_ENCAP, NOCAPS, "ENCAP * ADMINWALL :%s", parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
static void
|
||||
me_adminwall(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
sendto_wallops_flags(UMODE_ADMIN, source_p, "ADMINWALL - %s", parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue