diff options
Diffstat (limited to 'src/Network/Tox/Crypto/Transport.hs')
-rw-r--r-- | src/Network/Tox/Crypto/Transport.hs | 9 |
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 | |||
694 | lossyness (fromEnum -> 255) = Lossless | 695 | lossyness (fromEnum -> 255) = Lossless |
695 | lossyness _ = UnknownLossyness | 696 | lossyness _ = UnknownLossyness |
696 | 697 | ||
698 | isKillPacket :: MessageType -> Bool | ||
699 | isKillPacket (Msg KillPacket) = True | ||
700 | isKillPacket _ = False | ||
701 | |||
702 | isOFFLINE :: MessageType -> Bool | ||
703 | isOFFLINE (Msg OFFLINE) = True | ||
704 | isOFFLINE _ = False | ||
705 | |||
697 | -- TODO: Flesh this out. | 706 | -- TODO: Flesh this out. |
698 | data MessageID -- First byte indicates data | 707 | data 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) |