ContentsIndex
Barracuda.PendingAnonymous
MaintainerMartin Wegner
Description
A data structure used to observe the spreading of locally initiated anonymous messages.
Synopsis
data PendingAnonymousMessage = PendingAnonymousMessage {
ttl :: TTL
sender :: UserID
text :: String
attachments :: [Attachment]
time :: UTCTime
}
data PendingAnonymous
empty :: PendingAnonymous
insert :: UTCTime -> PendingAnonymousMessage -> PendingAnonymous -> PendingAnonymous
purgeNotPosted :: UTCTime -> NominalDiffTime -> PendingAnonymous -> (PendingAnonymous, [PendingAnonymousMessage])
purgeZeroTTL :: PendingAnonymous -> PendingAnonymous
posted :: String -> UTCTime -> PendingAnonymous -> PendingAnonymous
Documentation
data PendingAnonymousMessage
An anonymous message whose posting in the anonymous channel needs to be monitored.
Constructors
PendingAnonymousMessage
ttl :: TTL
sender :: UserID
text :: String
attachments :: [Attachment]
time :: UTCTime
data PendingAnonymous
PendingAnonymous maps the identifiers of an anonymous message, the text and the time, to the rest of the attributes and a timestamp when the message was added. This way it allows the monitoring of the posting of anonymous messages and provides the ability to re-post messages that (might) have been lost during the path obscuring.
show/hide Instances
empty :: PendingAnonymous
Builds an empty PendingAnonymous structure.
insert
:: UTCTimeTimestamp of now.
-> PendingAnonymousMessageThe message to be monitored.
-> PendingAnonymous
-> PendingAnonymous
Inserts the given message into the PendingAnonymous structure.
purgeNotPosted
:: UTCTimeTimestamp of now.
-> NominalDiffTimeTimeout for messages. Messages that were inserted before this timeout will be returned.
-> PendingAnonymous
-> (PendingAnonymous, [PendingAnonymousMessage])
Returns all anonymous messages and removes them from the structure that were not posted and that are older than the given time.
purgeZeroTTL :: PendingAnonymous -> PendingAnonymous
Purges all messages from the structure whose TTL elapsed.
posted
:: StringText of the message.
-> UTCTimeTimestamp of the message.
-> PendingAnonymous
-> PendingAnonymous
Takes the identifiers of an anonymous message and removes it from the structure (if existing).
Produced by Haddock version 0.8