diff options
Diffstat (limited to 'modules/m_invite.c')
-rw-r--r-- | modules/m_invite.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/modules/m_invite.c b/modules/m_invite.c index 21c9ac9..914ce54 100644 --- a/modules/m_invite.c +++ b/modules/m_invite.c @@ -1,8 +1,7 @@ /* - * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). - * m_invite.c: Invites the user to join a channel. + * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) * - * Copyright (C) 2002 by the past and present ircd coders, and others. + * Copyright (c) 1997-2014 ircd-hybrid development team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,8 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id$ + */ + +/*! \file m_invite.c + * \brief Includes required functions for processing the INVITE command. + * \version $Id$ */ #include "stdinc.h" @@ -46,7 +48,7 @@ ** parv[2] - channel name ** parv[3] - invite timestamp */ -static void +static int m_invite(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -55,13 +57,13 @@ m_invite(struct Client *client_p, struct Client *source_p, struct Membership *ms = NULL; if (IsServer(source_p)) - return; + return 0; if (EmptyString(parv[2])) { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "INVITE"); - return; + return 0; } if (MyClient(source_p) && !IsFloodDone(source_p)) @@ -71,35 +73,35 @@ m_invite(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, parv[1]); - return; + return 0; } if ((chptr = hash_find_channel(parv[2])) == NULL) { sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), me.name, source_p->name, parv[2]); - return; + return 0; } if (MyConnect(source_p) && (ms = find_channel_link(source_p, chptr)) == NULL) { sendto_one(source_p, form_str(ERR_NOTONCHANNEL), me.name, source_p->name, chptr->chname); - return; + return 0; } if (MyConnect(source_p) && !has_member_flags(ms, CHFL_CHANOP)) { sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), me.name, source_p->name, chptr->chname); - return; + return 0; } if (IsMember(target_p, chptr)) { - sendto_one(source_p, form_str(ERR_USERONCHANNEL), - me.name, source_p->name, target_p->name, chptr->chname); - return; + sendto_one(source_p, form_str(ERR_USERONCHANNEL), me.name, + source_p->name, target_p->name, chptr->chname); + return 0; } if (MyConnect(source_p)) @@ -114,7 +116,7 @@ m_invite(struct Client *client_p, struct Client *source_p, } else if (parc > 3 && IsDigit(*parv[3])) if (atoi(parv[3]) > chptr->channelts) - return; + return 0; if (MyConnect(target_p)) { @@ -139,9 +141,11 @@ m_invite(struct Client *client_p, struct Client *source_p, ID_or_name(source_p, target_p->from), ID_or_name(target_p, target_p->from), chptr->chname, (unsigned long)chptr->channelts); + return 0; } -static struct Message invite_msgtab = { +static struct Message invite_msgtab = +{ "INVITE", 0, 0, 3, MAXPARA, MFLG_SLOW, 0, { m_unregistered, m_invite, m_invite, m_ignore, m_invite, m_ignore } }; @@ -158,7 +162,8 @@ module_exit(void) mod_del_cmd(&invite_msgtab); } -struct module module_entry = { +struct module module_entry = +{ .node = { NULL, NULL, NULL }, .name = NULL, .version = "$Revision$", |