diff options
author | James Crayne <jim.crayne@gmail.com> | 2018-06-08 10:00:14 +0000 |
---|---|---|
committer | James Crayne <jim.crayne@gmail.com> | 2018-06-08 10:00:14 +0000 |
commit | f02276f5240cf985ec3c4c3eaa5d1f5bc3daf4e6 (patch) | |
tree | 8b4981012ffde1d1dbe43bfc7157356b3e352dfa | |
parent | 58c579498d062b6d8868926c386c42fb9dee753f (diff) |
add ONLINE&OFFLINE messages to last 10 message buffer
-rw-r--r-- | src/Network/Tox/Crypto/Handlers.hs | 10 |
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 | ||
1049 | sendOnline :: TransportCrypto -> NetCryptoSession -> IO (Either String ()) | 1049 | sendOnline :: TransportCrypto -> NetCryptoSession -> IO (Either String ()) |
1050 | sendOnline crypto session = sendCrypto crypto session (return ()) (OneByte ONLINE) | 1050 | sendOnline 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 | ||
1052 | sendOffline :: TransportCrypto -> NetCryptoSession -> IO (Either String ()) | 1055 | sendOffline :: TransportCrypto -> NetCryptoSession -> IO (Either String ()) |
1053 | sendOffline crypto session = sendCrypto crypto session (return ()) (OneByte OFFLINE) | 1056 | sendOffline 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 | ||
1056 | sendKill :: TransportCrypto -> NetCryptoSession -> IO (Either String ()) | 1062 | sendKill :: TransportCrypto -> NetCryptoSession -> IO (Either String ()) |