]>
jfr.im git - irc/quakenet/newserv.git/blob - chanserv/chancmds/unsuspendchan.c
1 /* Automatically generated by refactor.pl.
4 * CMDNAME: unsuspendchan
7 * CMDDESC: Unsuspends a channel from the bot.
8 * CMDFUNC: csc_dounsuspendchan
9 * CMDPROTO: int csc_dounsuspendchan(void *source, int cargc, char **cargv);
10 * CMDHELP: Usage: unsuspendchan <channel>
11 * CMDHELP: Unsuspends specified channel.
14 #include "../chanserv.h"
15 #include "../../nick/nick.h"
16 #include "../../lib/flags.h"
17 #include "../../lib/irc_string.h"
18 #include "../../channel/channel.h"
19 #include "../../parser/parser.h"
20 #include "../../irc/irc.h"
21 #include "../../localuser/localuserchannel.h"
25 int csc_dounsuspendchan(void *source
, int cargc
, char **cargv
) {
27 reguser
*rup
=getreguserfromnick(sender
);
35 chanservstdmessage(sender
, QM_NOTENOUGHPARAMS
, "unsuspendchan");
39 if (!(cip
=findchanindex(cargv
[0])) || !(rcp
=cip
->exts
[chanservext
])) {
40 chanservstdmessage(sender
, QM_UNKNOWNCHAN
, cargv
[0]);
44 if(!CIsSuspended(rcp
)) {
45 chanservstdmessage(sender
, QM_CHANNELNOTSUSPENDED
, cip
->name
->content
);
46 cs_log(sender
,"UNSUSPENDCHAN %s is not suspended",cip
->name
->content
);
51 cs_log(sender
,"UNSUSPENDCHAN %s (%s)",cip
->name
->content
,rcp
->suspendreason
->content
);
52 freesstring(rcp
->suspendreason
);
53 rcp
->suspendreason
= NULL
;
57 chanservjoinchan(cip
->channel
);
59 csdb_updatechannel(rcp
);
60 chanservstdmessage(sender
, QM_DONE
);