ContentsIndex
Barracuda.PendingKey
MaintainerMartin Wegner
Description
A data structure supporting the delaying of actions until the public key of some user could be retrieved over the network.
Synopsis
data PendingKey
type PendingKeyMessage = Either (UserID, PrivateKey, TargetContent) (UserID, TargetContent, UTCTime, Bool)
empty :: PendingKey
insert :: ChannelName -> ChannelID -> PendingKeyMessage -> PendingKey -> PendingKey
purge :: ChannelName -> ChannelID -> PendingKey -> (PendingKey, Maybe [PendingKeyMessage])
Documentation
data PendingKey
Stores PendingKeyMessages on a per-channel basis.
show/hide Instances
type PendingKeyMessage = Either (UserID, PrivateKey, TargetContent) (UserID, TargetContent, UTCTime, Bool)
A message waiting for a shared key of a private channel. Can be either a local message waiting to be encrypted and sent over the network or a foreign message waiting to be decrypted and sent to local users.
empty :: PendingKey
Builds an empty PendingKey structure.
insert
:: ChannelNameChannelName of the channel the shared key is missing for.
-> ChannelIDChannelID of the channel.
-> PendingKeyMessageThe message that cannot be de- or encrypted.
-> PendingKey
-> PendingKey
Inserts a PendingKeyMessage for the specified channel into a PendingKey.
purge
:: ChannelNameChannelName of channel to check for pending messages.
-> ChannelIDChannelID of the channel.
-> PendingKey
-> (PendingKey, Maybe [PendingKeyMessage])Returns a list of PendingKeyMessages or Nothing if no messages were stored.
Returns all PendingKeyMessages that are waiting for the key of the given channel.
Produced by Haddock version 0.8