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.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Network/Tox/Crypto/Transport.hs b/src/Network/Tox/Crypto/Transport.hs
index ea8565b2..68e3d8e1 100644
--- a/src/Network/Tox/Crypto/Transport.hs
+++ b/src/Network/Tox/Crypto/Transport.hs
@@ -235,8 +235,18 @@ instance Serialize CryptoData where
235-- The Enum instance on 'UserStatus' is not arbitrary. It corresponds 235-- The Enum instance on 'UserStatus' is not arbitrary. It corresponds
236-- to on-the-wire id numbers. 236-- to on-the-wire id numbers.
237data UserStatus = Online | Away | Busy deriving (Show,Read,Eq,Ord,Enum) 237data UserStatus = Online | Away | Busy deriving (Show,Read,Eq,Ord,Enum)
238instance Serialize UserStatus where
239 get = do
240 x <- get :: Get Word8
241 return (toEnum8 x)
242 put x = put (fromEnum8 x)
238 243
239data TypingStatus = NotTyping | Typing deriving (Show,Read,Eq,Ord,Enum) 244data TypingStatus = NotTyping | Typing deriving (Show,Read,Eq,Ord,Enum)
245instance Serialize TypingStatus where
246 get = do
247 x <- get :: Get Word8
248 return (toEnum8 x)
249 put x = put (fromEnum8 x :: Word8)
240 250
241unpadCryptoMsg :: CryptoMessage -> CryptoMessage 251unpadCryptoMsg :: CryptoMessage -> CryptoMessage
242unpadCryptoMsg x@(TwoByte Padding (toEnum8 -> mid)) 252unpadCryptoMsg x@(TwoByte Padding (toEnum8 -> mid))