summaryrefslogtreecommitdiff
path: root/src/Network/Tox
diff options
context:
space:
mode:
authorJames Crayne <jim.crayne@gmail.com>2018-06-08 10:00:14 +0000
committerJames Crayne <jim.crayne@gmail.com>2018-06-08 10:00:14 +0000
commitf02276f5240cf985ec3c4c3eaa5d1f5bc3daf4e6 (patch)
tree8b4981012ffde1d1dbe43bfc7157356b3e352dfa /src/Network/Tox
parent58c579498d062b6d8868926c386c42fb9dee753f (diff)
add ONLINE&OFFLINE messages to last 10 message buffer
Diffstat (limited to 'src/Network/Tox')
-rw-r--r--src/Network/Tox/Crypto/Handlers.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs
index e79b66fc..f59809fd 100644
--- a/src/Network/Tox/Crypto/Handlers.hs
+++ b/src/Network/Tox/Crypto/Handlers.hs
@@ -1047,10 +1047,16 @@ sendCrypto crypto session updateLocal cm = do
1047 PQ.OGEncodeFail -> return (Left "Failed to encode outgoing packet") 1047 PQ.OGEncodeFail -> return (Left "Failed to encode outgoing packet")
1048 1048
1049sendOnline :: TransportCrypto -> NetCryptoSession -> IO (Either String ()) 1049sendOnline :: TransportCrypto -> NetCryptoSession -> IO (Either String ())
1050sendOnline crypto session = sendCrypto crypto session (return ()) (OneByte ONLINE) 1050sendOnline crypto session = do
1051 let cm=OneByte ONLINE
1052 addMsgToLastN False (cm ^. messageType) session (Out cm)
1053 sendCrypto crypto session (return ()) (OneByte ONLINE)
1051 1054
1052sendOffline :: TransportCrypto -> NetCryptoSession -> IO (Either String ()) 1055sendOffline :: TransportCrypto -> NetCryptoSession -> IO (Either String ())
1053sendOffline crypto session = sendCrypto crypto session (return ()) (OneByte OFFLINE) 1056sendOffline crypto session = do
1057 let cm=OneByte OFFLINE
1058 addMsgToLastN False (cm ^. messageType) session (Out cm)
1059 sendCrypto crypto session (return ()) (OneByte OFFLINE)
1054 1060
1055 1061
1056sendKill :: TransportCrypto -> NetCryptoSession -> IO (Either String ()) 1062sendKill :: TransportCrypto -> NetCryptoSession -> IO (Either String ())