From f02276f5240cf985ec3c4c3eaa5d1f5bc3daf4e6 Mon Sep 17 00:00:00 2001 From: James Crayne Date: Fri, 8 Jun 2018 10:00:14 +0000 Subject: add ONLINE&OFFLINE messages to last 10 message buffer --- src/Network/Tox/Crypto/Handlers.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/Network/Tox/Crypto/Handlers.hs') 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 PQ.OGEncodeFail -> return (Left "Failed to encode outgoing packet") sendOnline :: TransportCrypto -> NetCryptoSession -> IO (Either String ()) -sendOnline crypto session = sendCrypto crypto session (return ()) (OneByte ONLINE) +sendOnline crypto session = do + let cm=OneByte ONLINE + addMsgToLastN False (cm ^. messageType) session (Out cm) + sendCrypto crypto session (return ()) (OneByte ONLINE) sendOffline :: TransportCrypto -> NetCryptoSession -> IO (Either String ()) -sendOffline crypto session = sendCrypto crypto session (return ()) (OneByte OFFLINE) +sendOffline crypto session = do + let cm=OneByte OFFLINE + addMsgToLastN False (cm ^. messageType) session (Out cm) + sendCrypto crypto session (return ()) (OneByte OFFLINE) sendKill :: TransportCrypto -> NetCryptoSession -> IO (Either String ()) -- cgit v1.2.3