74 |
|
if (flood_ctrl == true) |
75 |
|
++chptr->number_joined; |
76 |
|
|
77 |
< |
chptr->number_joined -= (CurrentTime - chptr->last_join_time) * |
77 |
> |
chptr->number_joined -= (event_base->time.sec_monotonic - chptr->last_join_time) * |
78 |
|
(((float)GlobalSetOptions.joinfloodcount) / |
79 |
|
(float)GlobalSetOptions.joinfloodtime); |
80 |
|
|
97 |
|
} |
98 |
|
} |
99 |
|
|
100 |
< |
chptr->last_join_time = CurrentTime; |
100 |
> |
chptr->last_join_time = event_base->time.sec_monotonic; |
101 |
|
} |
102 |
|
|
103 |
|
struct Membership *member = xcalloc(sizeof(*member)); |
334 |
|
chptr->hnextch = chptr; |
335 |
|
/* Doesn't hurt to set it here */ |
336 |
|
chptr->creationtime = CurrentTime; |
337 |
< |
chptr->last_join_time = CurrentTime; |
337 |
> |
chptr->last_join_time = event_base->time.sec_monotonic; |
338 |
|
|
339 |
|
/* Cache channel name length to avoid repetitive strlen() calls. */ |
340 |
|
chptr->name_len = strlcpy(chptr->name, name, sizeof(chptr->name)); |
507 |
|
struct Invite *invite = node->data; |
508 |
|
|
509 |
|
if (ConfigChannel.invite_expire_time && |
510 |
< |
ConfigChannel.invite_expire_time + invite->when < CurrentTime) |
510 |
> |
ConfigChannel.invite_expire_time + invite->when < event_base->time.sec_monotonic) |
511 |
|
del_invite(invite); |
512 |
|
else if (invite->chptr == chptr && invite->client_p == client_p) |
513 |
|
return invite; |
530 |
|
invite = xcalloc(sizeof(*invite)); |
531 |
|
invite->client_p = client_p; |
532 |
|
invite->chptr = chptr; |
533 |
< |
invite->when = CurrentTime; |
533 |
> |
invite->when = event_base->time.sec_monotonic; |
534 |
|
|
535 |
|
/* Delete last link in chain if the list is max length */ |
536 |
|
while (dlink_list_length(&client_p->connection->invited) && |
862 |
|
} |
863 |
|
else |
864 |
|
{ |
865 |
< |
unsigned int t_delta = CurrentTime - client_p->connection->last_leave_time; |
865 |
> |
unsigned int t_delta = event_base->time.sec_monotonic - client_p->connection->last_leave_time; |
866 |
|
if (t_delta > JOIN_LEAVE_COUNT_EXPIRE_TIME) |
867 |
|
{ |
868 |
|
unsigned int decrement_count = (t_delta / JOIN_LEAVE_COUNT_EXPIRE_TIME); |
873 |
|
} |
874 |
|
else |
875 |
|
{ |
876 |
< |
if ((CurrentTime - (client_p->connection->last_join_time)) < GlobalSetOptions.spam_time) |
876 |
> |
if ((event_base->time.sec_monotonic - (client_p->connection->last_join_time)) < GlobalSetOptions.spam_time) |
877 |
|
++client_p->connection->join_leave_count; /* It's a possible spambot */ |
878 |
|
} |
879 |
|
|
880 |
|
if (name) |
881 |
< |
client_p->connection->last_join_time = CurrentTime; |
881 |
> |
client_p->connection->last_join_time = event_base->time.sec_monotonic; |
882 |
|
else |
883 |
< |
client_p->connection->last_leave_time = CurrentTime; |
883 |
> |
client_p->connection->last_leave_time = event_base->time.sec_monotonic; |
884 |
|
} |
885 |
|
} |
886 |
|
|
1043 |
|
|
1044 |
|
channel_member_names(client_p, chptr, true); |
1045 |
|
|
1046 |
< |
client_p->connection->last_join_time = CurrentTime; |
1046 |
> |
client_p->connection->last_join_time = event_base->time.sec_monotonic; |
1047 |
|
} |
1048 |
|
} |
1049 |
|
|