]> jfr.im git - irc/quakenet/newserv.git/blame - chanserv/chancmds/invite.c
fix bug in G stats
[irc/quakenet/newserv.git] / chanserv / chancmds / invite.c
CommitLineData
1dd6d55d 1/* Automatically generated by refactor.pl.
2 *
3 *
4 * CMDNAME: invite
5 * CMDLEVEL: QCMD_AUTHED
6 * CMDARGS: 1
7 * CMDDESC: Invites you to a channel.
8 * CMDFUNC: csc_doinvite
9 * CMDPROTO: int csc_doinvite(void *source, int cargc, char **cargv);
1e32d528 10 * CMDHELP: Usage: INVITE <channel>
11 * CMDHELP: Invites you to the named channel, where:
12 * CMDHELP: channel - channel to be invited to.
13 * CMDHELP: INVITE requires you to be known (+k) on the named channel.
1dd6d55d 14 */
15
16#include "../chanserv.h"
17#include "../../nick/nick.h"
18#include "../../lib/flags.h"
19#include "../../lib/irc_string.h"
20#include "../../channel/channel.h"
21#include "../../parser/parser.h"
22#include "../../irc/irc.h"
23#include "../../localuser/localuserchannel.h"
24#include <string.h>
25#include <stdio.h>
26
27int csc_doinvite(void *source, int cargc, char **cargv) {
28 nick *sender=source;
29 chanindex *cip;
30
31 if (cargc<1) {
32 chanservstdmessage(sender, QM_NOTENOUGHPARAMS, "invite");
33 return CMD_ERROR;
34 }
35
36 if (!(cip=cs_checkaccess(sender, cargv[0], CA_KNOWN | CA_OFFCHAN,
37 NULL, "invite", 0, 0)))
38 return CMD_ERROR;
39
40 if (cip->channel) {
41 localinvite(chanservnick, cip->channel, sender);
42 }
43 chanservstdmessage(sender, QM_DONE);
44
45 return CMD_OK;
46}