Function is_follow_time_expired

Source
fn is_follow_time_expired(followed_summoner: &SummonerFollowedData) -> bool
Expand description

⚙️ Function: Determines if the follow time for a summoner has expired.

This function checks whether the current timestamp exceeds the stored follow end time for a summoner. It parses the time_end_follow field from the SummonerFollowedData struct, compares it to the current UTC timestamp, and returns true if the follow time has expired, or false otherwise.

§Parameters:

  • followed_summoner: A reference to a SummonerFollowedData struct, which contains information about the summoner, including when the follow period ends.

§Returns:

  • bool: Returns true if the current time is greater than the stored time_end_follow, meaning the follow period has expired. Returns false if the follow period is still active.

§Example:

This function is used to determine whether a summoner should be removed from the list of followed summoners.

let expired = is_follow_time_expired(&followed_summoner);
if expired {
    // Remove summoner from database
}

§Notes:

  • The function uses UTC time for comparison and assumes the time_end_follow is a valid timestamp that can be parsed into an i64. If parsing fails, it defaults to 0, which will always result in true.