806 |
|
stats_pending_glines(struct Client *source_p) |
807 |
|
{ |
808 |
|
#ifdef GLINE_VOTING |
809 |
< |
dlink_node *pending_node; |
810 |
< |
struct gline_pending *glp_ptr; |
811 |
< |
char timebuffer[MAX_DATE_STRING]; |
812 |
< |
struct tm *tmptr; |
809 |
> |
const dlink_node *dn_ptr = NULL; |
810 |
> |
const struct gp_ptr *glp_ptr = NULL; |
811 |
> |
char timebuffer[MAX_DATE_STRING] = { '\0' }; |
812 |
> |
struct tm *tmptr = NULL; |
813 |
|
|
814 |
|
if (!ConfigFileEntry.glines) |
815 |
|
{ |
818 |
|
return; |
819 |
|
} |
820 |
|
|
821 |
< |
if (dlink_list_length(&pending_glines) > 0) |
821 |
> |
if (dlink_list_length(&pending_glines[GLINE_PENDING_ADD_TYPE]) > 0) |
822 |
|
sendto_one(source_p, ":%s NOTICE %s :Pending G-lines", |
823 |
|
from, to); |
824 |
|
|
825 |
< |
DLINK_FOREACH(pending_node, pending_glines.head) |
825 |
> |
DLINK_FOREACH(dn_ptr, pending_glines[GLINE_PENDING_ADD_TYPE].head) |
826 |
|
{ |
827 |
< |
glp_ptr = pending_node->data; |
828 |
< |
tmptr = localtime(&glp_ptr->time_request1); |
827 |
> |
glp_ptr = dn_ptr->data; |
828 |
> |
tmptr = localtime(&glp_ptr->vote_1.time_request); |
829 |
|
strftime(timebuffer, MAX_DATE_STRING, "%Y/%m/%d %H:%M:%S", tmptr); |
830 |
|
|
831 |
|
sendto_one(source_p, |
832 |
|
":%s NOTICE %s :1) %s!%s@%s on %s requested gline at %s for %s@%s [%s]", |
833 |
< |
from, to, glp_ptr->oper_nick1, |
834 |
< |
glp_ptr->oper_user1, glp_ptr->oper_host1, |
835 |
< |
glp_ptr->oper_server1, timebuffer, |
836 |
< |
glp_ptr->user, glp_ptr->host, glp_ptr->reason1); |
833 |
> |
from, to, glp_ptr->vote_1.oper_nick, |
834 |
> |
glp_ptr->vote_1.oper_user, glp_ptr->vote_1.oper_host, |
835 |
> |
glp_ptr->vote_1.oper_server, timebuffer, |
836 |
> |
glp_ptr->user, glp_ptr->host, glp_ptr->vote_1.reason); |
837 |
|
|
838 |
|
if (glp_ptr->oper_nick2[0] != '\0') |
839 |
|
{ |
840 |
< |
tmptr = localtime(&glp_ptr->time_request2); |
840 |
> |
tmptr = localtime(&glp_ptr->vote_2.time_request); |
841 |
|
strftime(timebuffer, MAX_DATE_STRING, "%Y/%m/%d %H:%M:%S", tmptr); |
842 |
|
sendto_one(source_p, |
843 |
|
":%s NOTICE %s :2) %s!%s@%s on %s requested gline at %s for %s@%s [%s]", |
844 |
< |
from, to, glp_ptr->oper_nick2, |
845 |
< |
glp_ptr->oper_user2, glp_ptr->oper_host2, |
846 |
< |
glp_ptr->oper_server2, timebuffer, |
847 |
< |
glp_ptr->user, glp_ptr->host, glp_ptr->reason2); |
844 |
> |
from, to, glp_ptr->vote_2.oper_nick, |
845 |
> |
glp_ptr->vote_2.oper_user, glp_ptr->vote_2.oper_host, |
846 |
> |
glp_ptr->vote_2.oper_server, timebuffer, |
847 |
> |
glp_ptr->user, glp_ptr->host, glp_ptr->vote_2.reason); |
848 |
|
} |
849 |
|
} |
850 |
|
|
851 |
|
sendto_one(source_p, ":%s NOTICE %s :End of Pending G-lines", |
852 |
|
from, to); |
853 |
+ |
|
854 |
+ |
if (dlink_list_length(&pending_glines[GLINE_PENDING_DEL_TYPE]) > 0) |
855 |
+ |
sendto_one(source_p, ":%s NOTICE %s :Pending UNG-lines", |
856 |
+ |
from, to); |
857 |
+ |
|
858 |
+ |
DLINK_FOREACH(dn_ptr, pending_glines[GLINE_PENDING_DEL_TYPE].head) |
859 |
+ |
{ |
860 |
+ |
glp_ptr = dn_ptr->data; |
861 |
+ |
tmptr = localtime(&glp_ptr->vote_1.time_request); |
862 |
+ |
strftime(timebuffer, MAX_DATE_STRING, "%Y/%m/%d %H:%M:%S", tmptr); |
863 |
+ |
|
864 |
+ |
sendto_one(source_p, |
865 |
+ |
":%s NOTICE %s :1) %s!%s@%s on %s requested ungline at %s for %s@%s [%s]", |
866 |
+ |
from, to, glp_ptr->vote_1.oper_nick, |
867 |
+ |
glp_ptr->vote_1.oper_user, glp_ptr->vote_1.oper_host, |
868 |
+ |
glp_ptr->vote_1.oper_server, timebuffer, |
869 |
+ |
glp_ptr->user, glp_ptr->host, glp_ptr->vote_1.reason); |
870 |
+ |
|
871 |
+ |
if (glp_ptr->oper_nick2[0] != '\0') |
872 |
+ |
{ |
873 |
+ |
tmptr = localtime(&glp_ptr->vote_2.time_request); |
874 |
+ |
strftime(timebuffer, MAX_DATE_STRING, "%Y/%m/%d %H:%M:%S", tmptr); |
875 |
+ |
sendto_one(source_p, |
876 |
+ |
":%s NOTICE %s :2) %s!%s@%s on %s requested ungline at %s for %s@%s [%s]", |
877 |
+ |
from, to, glp_ptr->vote_2.oper_nick, |
878 |
+ |
glp_ptr->vote_2.oper_user, glp_ptr->vote_2.oper_host, |
879 |
+ |
glp_ptr->vote_2.oper_server, timebuffer, |
880 |
+ |
glp_ptr->user, glp_ptr->host, glp_ptr->vote_2.reason); |
881 |
+ |
|
882 |
+ |
} |
883 |
+ |
} |
884 |
+ |
|
885 |
+ |
sendto_one(source_p, ":%s NOTICE %s :End of Pending UNG-lines", |
886 |
+ |
from, to); |
887 |
|
#else |
888 |
|
sendto_one(source_p, ":%s NOTICE %s :This server does not support G-Line voting", |
889 |
|
from, to); |