]>
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);
10 * CMDHELP: Usage: suspendchanlist <pattern>
11 * CMDHELP: Lists all suspended channels that match the specified pattern.
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_dosuspendchanlist(void *source
, int cargc
, char **cargv
) {
27 reguser
*rup
=getreguserfromnick(sender
);
31 char *bywhom
, buf
[200];
38 chanservstdmessage(sender
, QM_NOTENOUGHPARAMS
, "suspendchanlist");
42 chanservstdmessage(sender
, QM_SUSPENDCHANLISTHEADER
);
43 for (i
=0; i
<CHANNELHASHSIZE
; i
++) {
44 for (cip
=chantable
[i
]; cip
; cip
=cip
->next
) {
45 if (!(rcp
=(regchan
*)cip
->exts
[chanservext
]))
48 if (!CIsSuspended(rcp
))
51 if ((rcp
->suspendby
!= rup
->ID
) && match(cargv
[0], cip
->name
->content
))
54 if (rcp
->suspendby
== rup
->ID
)
57 reguser
*trup
=findreguserbyID(rcp
->suspendby
);
59 bywhom
=trup
->username
;
65 tmp
=gmtime(&(rcp
->suspendtime
));
66 strftime(buf
,15,"%d/%m/%y %H:%M",tmp
);
68 chanservsendmessage(sender
, "%-30s %-15s %-15s %s", cip
->name
->content
, bywhom
, buf
, rcp
->suspendreason
?rcp
->suspendreason
->content
:"(no reason)");
70 chanservstdmessage(sender
, QM_TOOMANYRESULTS
, 2000, "channels");
75 chanservstdmessage(sender
, QM_RESULTCOUNT
, count
, "channel", (count
==1)?"":"s");