]>
jfr.im git - irc/quakenet/newserv.git/blob - chanserv/chancmds/suspendchanlist.c
1 /* Automatically generated by refactor.pl.
4 * CMDNAME: suspendchanlist
5 * CMDLEVEL: QCMD_HELPER
7 * CMDDESC: Lists suspended channels.
8 * CMDFUNC: csc_dosuspendchanlist
9 * CMDPROTO: int csc_dosuspendchanlist(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_dosuspendchanlist(void *source
, int cargc
, char **cargv
) {
25 reguser
*rup
=getreguserfromnick(sender
);
29 char *bywhom
, buf
[200];
36 chanservstdmessage(sender
, QM_NOTENOUGHPARAMS
, "suspendchanlist");
40 chanservstdmessage(sender
, QM_SUSPENDCHANLISTHEADER
);
41 for (i
=0; i
<CHANNELHASHSIZE
; i
++) {
42 for (cip
=chantable
[i
]; cip
; cip
=cip
->next
) {
43 if (!(rcp
=(regchan
*)cip
->exts
[chanservext
]))
46 if (!CIsSuspended(rcp
))
49 if ((rcp
->suspendby
!= rup
->ID
) && match(cargv
[0], cip
->name
->content
))
52 if (rcp
->suspendby
== rup
->ID
)
55 reguser
*trup
=findreguserbyID(rcp
->suspendby
);
57 bywhom
=trup
->username
;
63 tmp
=gmtime(&(rcp
->suspendtime
));
64 strftime(buf
,15,"%d/%m/%y %H:%M",tmp
);
66 chanservsendmessage(sender
, "%-30s %-15s %-15s %s", cip
->name
->content
, bywhom
, buf
, rcp
->suspendreason
->content
);
68 chanservstdmessage(sender
, QM_TOOMANYRESULTS
, 2000, "channels");
73 chanservstdmessage(sender
, QM_RESULTCOUNT
, count
, "channel", (count
==1)?"":"s");