]>
jfr.im git - irc/quakenet/newserv.git/blob - chanserv/newsearch/formats.c
3 #include "../chanserv.h"
4 #include "../../newsearch/newsearch.h"
5 #include "../../control/control.h"
7 void printchannel_qusers(nick
*sender
, chanindex
*cip
) {
11 int own
=0,mas
=0,op
=0,voi
=0,kno
=0,ban
=0,tot
=0;
13 if (!(rcp
=cip
->exts
[chanservext
])) {
14 controlreply(sender
,"[ - not registered - ] %s",cip
->name
->content
);
18 for (i
=0;i
<REGCHANUSERHASHSIZE
;i
++) {
19 for (rcup
=rcp
->regusers
[i
];rcup
;rcup
=rcup
->nextbychan
) {
22 if (CUIsOwner(rcup
)) own
++; else
23 if (CUIsMaster(rcup
)) mas
++; else
24 if (CUIsOp(rcup
)) op
++; else
25 if (CUIsVoice(rcup
)) voi
++; else
26 if (CUIsKnown(rcup
)) kno
++;
28 if (CUIsBanned(rcup
)) ban
++;
32 controlreply(sender
,"[%4dn %4dm %4do %4dv %4dk %4db - %4d total ] %s",own
,mas
,op
,voi
,kno
,ban
,tot
,cip
->name
->content
);
36 void printnick_auth(nick
*sender
, nick
*np
) {
39 if (!(rup
=getreguserfromnick(np
))) {
40 controlreply(sender
,"%s (not authed)",np
->nick
);
42 controlreply(sender
,"%s (%s/%u) (%s) (%s)",np
->nick
,rup
->username
,rup
->ID
,
43 rup
->email
? rup
->email
->content
: "no email",
44 rup
->comment
? rup
->comment
->content
: "no comment" );
48 void printnick_authchans(nick
*sender
, nick
*np
) {
50 struct regchanuser
*rcup
;
53 unsigned int bufpos
=0, buf2len
;
56 printnick_auth(sender
,np
);
58 if (!(rup
=getreguserfromnick(np
)))
62 controlreply(sender
, " (no channels)");
64 for (rcup
=rup
->knownon
;rcup
;rcup
=rcup
->nextbyuser
) {
67 else if (CUHasMasterPriv(rcup
))
69 else if (CUHasOpPriv(rcup
))
71 else if (CUHasVoicePriv(rcup
))
73 else if (CUKnown(rcup
))
78 buf2len
=sprintf(buf2
,"%c%s",ch
,rcup
->chan
->index
->name
->content
);
80 if (buf2len
+bufpos
> 400) {
81 controlreply(sender
," %s", thebuf
);
84 bufpos
+=sprintf(thebuf
+bufpos
,"%s ",buf2
);
87 controlreply(sender
," %s", thebuf
);