summaryrefslogtreecommitdiff
path: root/src/Network/Tox/Crypto/Transport.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/Tox/Crypto/Transport.hs')
-rw-r--r--src/Network/Tox/Crypto/Transport.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Network/Tox/Crypto/Transport.hs b/src/Network/Tox/Crypto/Transport.hs
index 3133ee9b..70405a3e 100644
--- a/src/Network/Tox/Crypto/Transport.hs
+++ b/src/Network/Tox/Crypto/Transport.hs
@@ -21,6 +21,7 @@ module Network.Tox.Crypto.Transport
21 , TypingStatus(..) 21 , TypingStatus(..)
22 , GroupChatId(..) 22 , GroupChatId(..)
23 , MessageType(..) 23 , MessageType(..)
24 , isKillPacket, isOFFLINE
24 , KnownLossyness(..) 25 , KnownLossyness(..)
25 , AsWord16(..) 26 , AsWord16(..)
26 , AsWord64(..) 27 , AsWord64(..)
@@ -694,6 +695,14 @@ lossyness (fromEnum -> x) | x >= 192, x < 255 = Lossy
694lossyness (fromEnum -> 255) = Lossless 695lossyness (fromEnum -> 255) = Lossless
695lossyness _ = UnknownLossyness 696lossyness _ = UnknownLossyness
696 697
698isKillPacket :: MessageType -> Bool
699isKillPacket (Msg KillPacket) = True
700isKillPacket _ = False
701
702isOFFLINE :: MessageType -> Bool
703isOFFLINE (Msg OFFLINE) = True
704isOFFLINE _ = False
705
697-- TODO: Flesh this out. 706-- TODO: Flesh this out.
698data MessageID -- First byte indicates data 707data MessageID -- First byte indicates data
699 = Padding -- ^ 0 padding (skipped until we hit a non zero (data id) byte) 708 = Padding -- ^ 0 padding (skipped until we hit a non zero (data id) byte)