add a yes/no confirm for xmpp pairing requests

This commit is contained in:
Joey Hess 2012-11-11 22:29:16 -04:00
parent 9f5b23d49f
commit 8b22bd8831
5 changed files with 18 additions and 4 deletions

View file

@ -128,6 +128,17 @@ getFinishLocalPairR msg = promptSecret (Just msg) $ \_ secret -> do
getFinishLocalPairR _ = noLocalPairing
#endif
getConfirmXMPPPairR :: PairKey -> Handler RepHtml
#ifdef WITH_XMPP
getConfirmXMPPPairR pairkey@(PairKey _ t) = case parseJID t of
Nothing -> error "bad JID"
Just theirjid -> pairPage $ do
let name = buddyName theirjid
$(widgetFile "configurators/pairing/xmpp/confirm")
#else
getConfirmXMPPPairR _ = noXMPPPairing
#endif
getFinishXMPPPairR :: PairKey -> Handler RepHtml
#ifdef WITH_XMPP
getFinishXMPPPairR (PairKey theiruuid t) = case parseJID t of
@ -140,7 +151,7 @@ getFinishXMPPPairR (PairKey theiruuid t) = case parseJID t of
finishXMPPPairing theirjid theiruuid
xmppPairEnd False $ Just theirjid
#else
getFinishXMPPPairR _ _ = noXMPPPairing
getFinishXMPPPairR _ = noXMPPPairing
#endif
#ifdef WITH_XMPP