]>
jfr.im git - irc/quakenet/newserv.git/blob - chanserv/usercmds/spewemail.c
1 /* Automatically generated by refactor.pl.
7 * CMDDESC: Search for an e-mail in the database.
8 * CMDFUNC: csu_dospewemail
9 * CMDPROTO: int csu_dospewemail(void *source, int cargc, char **cargv);
10 * CMDHELP: Usage: spewdb <pattern>
11 * CMDHELP: Displays all users with email addresses that match the supplied pattern.
14 #include "../chanserv.h"
15 #include "../../lib/irc_string.h"
19 int csu_dospewemail(void *source
, int cargc
, char **cargv
) {
21 reguser
*rup
=getreguserfromnick(sender
);
30 chanservstdmessage(sender
, QM_NOTENOUGHPARAMS
, "spewemail");
34 chanservstdmessage(sender
, QM_SPEWHEADER
);
35 for (i
=0;i
<REGUSERHASHSIZE
;i
++) {
36 for (dbrup
=regusernicktable
[i
]; dbrup
; dbrup
=dbrup
->nextbyname
) {
39 if (!match(cargv
[0], dbrup
->email
->content
)) {
40 chanservsendmessage(sender
, "%-15s %-10s %-30s %s", dbrup
->username
, UHasSuspension(dbrup
)?"yes":"no", dbrup
->email
?dbrup
->email
->content
:"none set", dbrup
->lastuserhost
?dbrup
->lastuserhost
->content
:"none");
43 chanservstdmessage(sender
, QM_TOOMANYRESULTS
, 2000, "users");
49 chanservstdmessage(sender
, QM_RESULTCOUNT
, count
, "user", (count
==1)?"":"s");