]>
jfr.im git - irc/quakenet/newserv.git/blob - chanserv/chancmds/settopic.c
1 /* Automatically generated by refactor.pl.
5 * CMDLEVEL: QCMD_AUTHED
7 * CMDDESC: Changes the topic on a channel.
8 * CMDFUNC: csc_dosettopic
9 * CMDPROTO: int csc_dosettopic(void *source, int cargc, char **cargv);
10 * CMDHELP: Usage: SETTOPIC <channel> [<topic>]
11 * CMDHELP: Changes the topic on the channel, where:
12 * CMDHELP: channel - channel to use
13 * CMDHELP: topic - new topic. If no topic is set, the stored topic will be reset (this
14 * CMDHELP: feature is useful if some users can no longer see the topic due to a
16 * CMDHELP: SETTOPIC requires topic (+t) or master (+m) access on the named channel.
19 #include "../chanserv.h"
20 #include "../../nick/nick.h"
21 #include "../../lib/flags.h"
22 #include "../../lib/irc_string.h"
23 #include "../../channel/channel.h"
24 #include "../../parser/parser.h"
25 #include "../../irc/irc.h"
26 #include "../../localuser/localuserchannel.h"
30 int csc_dosettopic(void *source
, int cargc
, char **cargv
) {
36 chanservstdmessage(sender
, QM_NOTENOUGHPARAMS
, "settopic");
40 if (!(cip
=cs_checkaccess(sender
, cargv
[0], CA_TOPICPRIV
,
41 NULL
, "settopic", 0, 0)))
44 rcp
=cip
->exts
[chanservext
];
48 freesstring(rcp
->topic
);
49 rcp
->topic
=getsstring(cargv
[1],TOPICLEN
);
52 if (rcp
->topic
&& cip
->channel
) {
53 localsettopic(chanservnick
, cip
->channel
, rcp
->topic
->content
);
56 chanservstdmessage(sender
, QM_DONE
);
57 csdb_updatechannel(rcp
);