ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/channel.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/channel.c (file contents):
Revision 8809 by michael, Sat Jan 19 19:58:19 2019 UTC vs.
Revision 8903 by michael, Sun Apr 21 20:43:53 2019 UTC

# Line 74 | Line 74 | add_user_to_channel(struct Channel *chpt
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  
# Line 97 | Line 97 | add_user_to_channel(struct Channel *chpt
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));
# Line 334 | Line 334 | channel_make(const char *name)
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));
# Line 507 | Line 507 | find_invite(struct Channel *chptr, struc
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;
# Line 530 | Line 530 | add_invite(struct Channel *chptr, struct
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) &&
# Line 862 | Line 862 | check_spambot_warning(struct Client *cli
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);
# Line 873 | Line 873 | check_spambot_warning(struct Client *cli
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  
# Line 1043 | Line 1043 | channel_do_join(struct Client *client_p,
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)