class HistoryRatings

Defined in:

privateparlor/history/history_ratings.cr

Constructors

Instance Method Summary

Instance methods inherited from class History

add_to_cache(origin_msid : Int64, msid : Int64, receiver_id : Int64) : Nil add_to_cache, del_message_group(msid : Int64) : Int64 del_message_group, expire : Nil expire, expired?(message : MessageGroup) : Bool expired?, get_all_msids(msid : Int64) : Hash get_all_msids, get_msid(msid : Int64, receiver_id : Int64) : Int64 | Nil get_msid, get_msids_from_user(uid : Int64) : Set(Int64) get_msids_from_user, get_origin_msid(msid : Int64) : Int64 | Nil get_origin_msid, get_sender_id(msid : Int64) : Int64 | Nil get_sender_id, lifespan : Time::Span lifespan, msid_map : Hash(Int64, MessageGroup) msid_map, new_message(sender_id : Int64, msid : Int64) : Int64 new_message

Constructor methods inherited from class History

new(message_life : Time::Span) new

Constructor Detail

def self.new(message_life : Time::Span) #

[View source]

Instance Method Detail

def add_rating(msid : Int64, uid : Int64) : Bool #

Update the ratings set in the associated MessageGroup

Returns true if the user was added to the ratings set; false if the user was already in it.


[View source]
def new_message(sender_id : Int64, msid : Int64) : Int64 #

Creates a new MessageGroup with the sender_id and its associated msid

Returns the original msid of the new MessageGroup


[View source]