diff options
Diffstat (limited to 'src/Network/Tox/Crypto/Transport.hs')
-rw-r--r-- | src/Network/Tox/Crypto/Transport.hs | 10 |
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. |
237 | data UserStatus = Online | Away | Busy deriving (Show,Read,Eq,Ord,Enum) | 237 | data UserStatus = Online | Away | Busy deriving (Show,Read,Eq,Ord,Enum) |
238 | instance Serialize UserStatus where | ||
239 | get = do | ||
240 | x <- get :: Get Word8 | ||
241 | return (toEnum8 x) | ||
242 | put x = put (fromEnum8 x) | ||
238 | 243 | ||
239 | data TypingStatus = NotTyping | Typing deriving (Show,Read,Eq,Ord,Enum) | 244 | data TypingStatus = NotTyping | Typing deriving (Show,Read,Eq,Ord,Enum) |
245 | instance Serialize TypingStatus where | ||
246 | get = do | ||
247 | x <- get :: Get Word8 | ||
248 | return (toEnum8 x) | ||
249 | put x = put (fromEnum8 x :: Word8) | ||
240 | 250 | ||
241 | unpadCryptoMsg :: CryptoMessage -> CryptoMessage | 251 | unpadCryptoMsg :: CryptoMessage -> CryptoMessage |
242 | unpadCryptoMsg x@(TwoByte Padding (toEnum8 -> mid)) | 252 | unpadCryptoMsg x@(TwoByte Padding (toEnum8 -> mid)) |