]>
jfr.im git - irc/quakenet/newserv.git/blob - trusts2/trusts_ident.c
3 trustgroupidentcount_t
*getnewtrustgroupidentcount(trustgroup_t
*tg
, char *ident
) {
4 trustgroupidentcount_t
*tgic
= newtrustgroupidentcount();
5 tgic
->ident
= getsstring(ident
,USERLEN
);
9 trusts_addtrustgroupidenttohash(tgic
);
13 void increment_ident_count(nick
*np
, trustgroup_t
*tg
) {
14 trustgroupidentcount_t
* identcnt
;
15 identcnt
= findtrustgroupcountbyident(np
->ident
,tg
);
18 if( tg
->maxperident
&& (identcnt
->currenton
+1) > tg
->maxperident
) {
19 trust_debug("NEWNICK TRUSTED BAD USER: Exceeding User (%s) Ident Limit (%d/%d)",np
->ident
, identcnt
->currenton
+1, tg
->maxperident
);
20 //killuser(NULL, np, "USER: Exceeding User Ident Limit.");
22 identcnt
->currenton
++;
24 /* we have a new user to add */
25 getnewtrustgroupidentcount( tg
, np
->ident
);
29 void decrement_ident_count(nick
*np
, trustgroup_t
*tg
) {
30 trustgroupidentcount_t
* identcnt
;
31 identcnt
= findtrustgroupcountbyident(np
->ident
,tg
);
33 identcnt
->currenton
--;
34 if(identcnt
->currenton
== 0) {
35 trusts_removetrustgroupidentfromhash(identcnt
);
36 if (identcnt
->ident
) {
37 freesstring(identcnt
->ident
);
39 freetrustgroupidentcount(identcnt
);