]>
jfr.im git - irc/quakenet/newserv.git/blob - chanserv/chancmds/welcome.c
1 /* Automatically generated by refactor.pl.
5 * CMDLEVEL: QCMD_AUTHED
7 * CMDDESC: Shows or changes the welcome message on a channel.
8 * CMDFUNC: csc_dowelcome
9 * CMDPROTO: int csc_dowelcome(void *source, int cargc, char **cargv);
12 #include "../chanserv.h"
13 #include "../../nick/nick.h"
14 #include "../../lib/flags.h"
15 #include "../../lib/irc_string.h"
16 #include "../../channel/channel.h"
17 #include "../../parser/parser.h"
18 #include "../../irc/irc.h"
19 #include "../../localuser/localuserchannel.h"
23 int csc_dowelcome(void *source
, int cargc
, char **cargv
) {
30 chanservstdmessage(sender
, QM_NOTENOUGHPARAMS
, "welcome");
34 if (!(cip
=cs_checkaccess(sender
, cargv
[0], CA_OPPRIV
, NULL
, "welcome",
35 QPRIV_VIEWWELCOME
, 0)))
38 rcp
=cip
->exts
[chanservext
];
41 if (!cs_checkaccess(sender
, NULL
, CA_MASTERPRIV
, cip
, "welcome",
42 QPRIV_CHANGEWELCOME
, 0))
45 oldwelcome
=rcp
->welcome
;
47 rcp
->welcome
=getsstring(cargv
[1], 500);
48 csdb_updatechannel(rcp
);
50 cs_log(sender
,"WELCOME %s %s (was %s)",cip
->name
->content
,rcp
->welcome
->content
,oldwelcome
?oldwelcome
->content
:"unset");
51 freesstring(oldwelcome
);
52 chanservstdmessage(sender
, QM_DONE
);
55 chanservstdmessage(sender
, QM_WELCOMEMESSAGEIS
, rcp
->index
->name
->content
,
56 rcp
->welcome
?rcp
->welcome
->content
:"(none)");