From f5f4934886a3a8aab4c8a8913346ca30bff80314 Mon Sep 17 00:00:00 2001 From: "jim@bo" Date: Wed, 20 Jun 2018 20:47:59 -0400 Subject: debug message in defaultUnRecHook --- src/Network/Tox/Crypto/Handlers.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (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 dbfaede6..35681c4a 100644 --- a/src/Network/Tox/Crypto/Handlers.hs +++ b/src/Network/Tox/Crypto/Handlers.hs @@ -370,6 +370,8 @@ data NetCryptoSession = NCrypto -- ^ user interfaces may "listen" by inserting themselves into this map -- with a unique id and a new TChan, and then reading from the TChan } +instance Eq NetCryptoSession where + x == y = ncSessionId x == ncSessionId y data NetCryptoSessions = NCSessions { netCryptoSessions :: TVar (Map.Map SockAddr NetCryptoSession) @@ -1320,7 +1322,9 @@ defaultStatusMsgHook session cm@(UpToN {msgID=STATUSMESSAGE, msgBytes=msg}) = do -- | updates ncLastNMsgs, and sends message to type-0 listeners defaultUnRecHook :: MessageType -> NetCryptoHook -defaultUnRecHook = hookHelper False +defaultUnRecHook typ session cm = do + dput XNetCrypto $ "(NetCrypto) defaultUnRecHook: packet (sessionid: " ++ show (ncSessionId session) ++ ") " ++ show cm + hookHelper False typ session cm hookHelper :: Bool -> MessageType -> NetCryptoHook hookHelper _ typ session cm | any ($ typ) [isKillPacket, isOFFLINE] = atomically $ do -- cgit v1.2.3