diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2022-02-19 20:46:13 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2022-02-19 20:46:13 +0100 |
commit | 042257ea5982466744a49025bdd6fea8322d98dc (patch) | |
tree | c92b20afd8a565899a714d48e597784f2fbe8dee /src/Pairing.hs | |
parent | 42f169d7c0b781024c858556b93312f69bd73246 (diff) |
Pairing: rename 'decline' to 'reject'
Diffstat (limited to 'src/Pairing.hs')
-rw-r--r-- | src/Pairing.hs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Pairing.hs b/src/Pairing.hs index 2c3f2ff..7c4b7e6 100644 --- a/src/Pairing.hs +++ b/src/Pairing.hs @@ -33,7 +33,7 @@ data PairingService a = PairingRequest RefDigest | PairingResponse Bytes | PairingRequestNonce Bytes | PairingAccept a - | PairingDecline + | PairingReject data PairingState a = NoPairing | OurRequest Bytes @@ -73,19 +73,19 @@ instance Storable a => Storable (PairingService a) where store' (PairingResponse x) = storeRec $ storeBinary "response" x store' (PairingRequestNonce x) = storeRec $ storeBinary "reqnonce" x store' (PairingAccept x) = store' x - store' (PairingDecline) = storeRec $ storeText "decline" "" + store' (PairingReject) = storeRec $ storeText "reject" "" load' = do res <- loadRec $ do (req :: Maybe Bytes) <- loadMbBinary "request" rsp <- loadMbBinary "response" rnonce <- loadMbBinary "reqnonce" - (decline :: Maybe T.Text) <- loadMbText "decline" + (rej :: Maybe T.Text) <- loadMbText "reject" return $ catMaybes [ PairingRequest <$> (refDigestFromByteString =<< req) , PairingResponse <$> rsp , PairingRequestNonce <$> rnonce - , const PairingDecline <$> decline + , const PairingReject <$> rej ] case res of x:_ -> return x @@ -110,7 +110,7 @@ instance PairingResult a => Service (PairingService a) where (NoPairing, _) -> return () (PairingDone, _) -> return () - (_, PairingDecline) -> do + (_, PairingReject) -> do join $ asks $ pairingHookRejected . svcAttributes svcSet NoPairing @@ -133,7 +133,7 @@ instance PairingResult a => Service (PairingService a) where Nothing -> do join $ asks $ pairingHookVerifyFailed . svcAttributes svcSet NoPairing - replyPacket PairingDecline + replyPacket PairingReject (OurRequestConfirm _, _) -> reject @@ -159,7 +159,7 @@ instance PairingResult a => Service (PairingService a) where svcSet PeerRequestConfirm else do join $ asks $ pairingHookRequestNonceFailed . svcAttributes svcSet NoPairing - replyPacket PairingDecline + replyPacket PairingReject (PeerRequest _ _, _) -> reject (PeerRequestConfirm, _) -> reject @@ -167,7 +167,7 @@ reject :: PairingResult a => ServiceHandler (PairingService a) () reject = do join $ asks $ pairingHookFailed . svcAttributes svcSet NoPairing - replyPacket PairingDecline + replyPacket PairingReject nonceDigest :: UnifiedIdentity -> UnifiedIdentity -> Bytes -> Bytes -> RefDigest |