abstract class History
- History
- Reference
- Object
Direct Known Subclasses
Defined in:
privateparlor/history/history.crConstructors
Instance Method Summary
-
#add_to_cache(origin_msid : Int64, msid : Int64, receiver_id : Int64) : Nil
Adds receiver_id and its associated msid to an existing
MessageGroup
-
#del_message_group(msid : Int64) : Int64
Deletes a
MessageGroup
from#msid_map
, including any msids that reference thisMessageGroup
-
#expire : Nil
Delete messages which have expired.
-
#expired?(message : MessageGroup) : Bool
Returns
true
if message is currently older than the given#lifespan
. -
#get_all_msids(msid : Int64) : Hash
Returns the receivers hash found in the associated
MessageGroup
-
#get_msid(msid : Int64, receiver_id : Int64) : Int64 | Nil
Returns the receivers msid found in the associated
MessageGroup
-
#get_msids_from_user(uid : Int64) : Set(Int64)
Retuns a set containing all msids sent by a given user.
-
#get_origin_msid(msid : Int64) : Int64 | Nil
Returns the original MSID of the associated
MessageGroup
-
#get_sender_id(msid : Int64) : Int64 | Nil
Returns the sender of a specific
MessageGroup
- #lifespan : Time::Span
- #msid_map : Hash(Int64, MessageGroup)
-
#new_message(sender_id : Int64, msid : Int64) : Int64
Creates a new
MessageGroup
with the sender_id and its associated msid
Constructor Detail
Instance Method Detail
Adds receiver_id and its associated msid to an existing MessageGroup
Deletes a MessageGroup
from #msid_map
,
including any msids that reference this MessageGroup
Returns the origin_msid
of the given MessageGroup
Delete messages which have expired.
Grabs MSIDs from MessageGroup
receivers and deletes the messages from the history.
Returns true
if message is currently older than the given #lifespan
.
Returns false
otherwise.
Returns the receivers hash found in the associated MessageGroup
Returns the receivers msid found in the associated MessageGroup
Retuns a set containing all msids sent by a given user.
Returns the original MSID of the associated MessageGroup
Creates a new MessageGroup
with the sender_id and its associated msid
Returns the original msid of the new MessageGroup