]>
jfr.im git - irc/quakenet/newserv.git/blob - chanserv/newsearch/formats.c
1 #include "../chanserv.h"
2 #include "../../newsearch/newsearch.h"
3 #include "../../control/control.h"
5 void printnick_auth(nick
*sender
, nick
*np
) {
8 if (!(rup
=getreguserfromnick(np
))) {
9 controlreply(sender
,"%s (not authed)",np
->nick
);
11 controlreply(sender
,"%s (%s/%u) (%s) (%s)",np
->nick
,rup
->username
,rup
->ID
,
12 rup
->email
? rup
->email
->content
: "no email",
13 rup
->comment
? rup
->comment
->content
: "no comment" );
17 void printnick_authchans(nick
*sender
, nick
*np
) {
19 struct regchanuser
*rcup
;
22 unsigned int bufpos
=0, buf2len
;
25 printnick_auth(sender
,np
);
27 if (!(rup
=getreguserfromnick(np
)))
31 controlreply(sender
, " (no channels)");
33 for (rcup
=rup
->knownon
;rcup
;rcup
=rcup
->nextbyuser
) {
36 else if (CUHasMasterPriv(rcup
))
38 else if (CUHasOpPriv(rcup
))
40 else if (CUHasVoicePriv(rcup
))
42 else if (CUKnown(rcup
))
47 buf2len
=sprintf(buf2
,"%c%s",ch
,rcup
->chan
->index
->name
->content
);
49 if (buf2len
+bufpos
> 400) {
50 controlreply(sender
," %s", thebuf
);
53 bufpos
+=sprintf(thebuf
+bufpos
,"%s ",buf2
);
56 controlreply(sender
," %s", thebuf
);