summaryrefslogtreecommitdiff
path: root/src/Attach.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2021-12-28 22:46:43 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2021-12-29 23:32:41 +0100
commita6b07d2758c185cde10a0b07161c18c288c02cfc (patch)
tree68683452817d0f91a2aa1110692fbd698b9de769 /src/Attach.hs
parente9760baab9608419565e253cae101b24f87eb8e5 (diff)
Pairing: reject and restart
Diffstat (limited to 'src/Attach.hs')
-rw-r--r--src/Attach.hs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Attach.hs b/src/Attach.hs
index c220e14..90c9900 100644
--- a/src/Attach.hs
+++ b/src/Attach.hs
@@ -1,6 +1,8 @@
module Attach (
AttachService,
- attachToOwner, attachAccept,
+ attachToOwner,
+ attachAccept,
+ attachReject,
) where
import Control.Monad.Except
@@ -103,6 +105,12 @@ instance PairingResult AttachIdentity where
, pairingHookVerifyFailed = do
svcPrint $ "Failed to verify new identity"
+
+ , pairingHookRejected = do
+ svcPrint $ "Attachment rejected by peer"
+
+ , pairingHookFailed = do
+ svcPrint $ "Attachement failed"
}
attachToOwner :: (MonadIO m, MonadError String m) => Peer -> m ()
@@ -110,3 +118,6 @@ attachToOwner = pairingRequest @AttachIdentity Proxy
attachAccept :: (MonadIO m, MonadError String m) => Peer -> m ()
attachAccept = pairingAccept @AttachIdentity Proxy
+
+attachReject :: (MonadIO m, MonadError String m) => Peer -> m ()
+attachReject = pairingReject @AttachIdentity Proxy