diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2021-12-28 22:46:43 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2021-12-29 23:32:41 +0100 |
commit | a6b07d2758c185cde10a0b07161c18c288c02cfc (patch) | |
tree | 68683452817d0f91a2aa1110692fbd698b9de769 /src/Contact.hs | |
parent | e9760baab9608419565e253cae101b24f87eb8e5 (diff) |
Pairing: reject and restart
Diffstat (limited to 'src/Contact.hs')
-rw-r--r-- | src/Contact.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Contact.hs b/src/Contact.hs index a4b5cf2..73a179f 100644 --- a/src/Contact.hs +++ b/src/Contact.hs @@ -5,6 +5,7 @@ module Contact ( ContactService, contactRequest, contactAccept, + contactReject, ) where import Control.Arrow @@ -127,6 +128,12 @@ instance PairingResult ContactAccepted where svcPrint $ "Contact accepted" , pairingHookVerifyFailed = return () + + , pairingHookRejected = do + svcPrint $ "Contact rejected by peer" + + , pairingHookFailed = do + svcPrint $ "Contact failed" } contactRequest :: (MonadIO m, MonadError String m) => Peer -> m () @@ -135,6 +142,9 @@ contactRequest = pairingRequest @ContactAccepted Proxy contactAccept :: (MonadIO m, MonadError String m) => Peer -> m () contactAccept = pairingAccept @ContactAccepted Proxy +contactReject :: (MonadIO m, MonadError String m) => Peer -> m () +contactReject = pairingReject @ContactAccepted Proxy + finalizeContact :: MonadIO m => UnifiedIdentity -> Stored LocalState -> m (Stored LocalState) finalizeContact identity slocal = liftIO $ do let st = storedStorage slocal |