diff --git a/Assistant/Threads/XMPPClient.hs b/Assistant/Threads/XMPPClient.hs index f526a9574b..df602df60f 100644 --- a/Assistant/Threads/XMPPClient.hs +++ b/Assistant/Threads/XMPPClient.hs @@ -222,7 +222,7 @@ pairMsgReceived urlrenderer PairReq theiruuid selfjid theirjid finishXMPPPairing theirjid theiruuid -- Show an alert to let the user decide if they want to pair. showalert = do - let route = FinishXMPPPairR (PairKey theiruuid $ formatJID theirjid) + let route = ConfirmXMPPPairR (PairKey theiruuid $ formatJID theirjid) url <- liftIO $ renderUrl urlrenderer route [] close <- asIO1 removeAlert void $ addAlert $ pairRequestReceivedAlert (T.unpack $ buddyName theirjid) diff --git a/Assistant/WebApp/Configurators/Pairing.hs b/Assistant/WebApp/Configurators/Pairing.hs index 964b28ab90..1675f572d8 100644 --- a/Assistant/WebApp/Configurators/Pairing.hs +++ b/Assistant/WebApp/Configurators/Pairing.hs @@ -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 diff --git a/Assistant/WebApp/routes b/Assistant/WebApp/routes index 1af4eb8708..2d646724d0 100644 --- a/Assistant/WebApp/routes +++ b/Assistant/WebApp/routes @@ -31,6 +31,7 @@ /config/repository/pair/local/finish/#PairMsg FinishLocalPairR GET /config/repository/pair/xmpp/start StartXMPPPairR GET /config/repository/pair/xmpp/running/#BuddyKey RunningXMPPPairR GET +/config/repository/pair/xmpp/accept/#PairKey ConfirmXMPPPairR GET /config/repository/pair/xmpp/finish/#PairKey FinishXMPPPairR GET /config/repository/enable/rsync/#UUID EnableRsyncR GET diff --git a/templates/configurators/pairing/local/prompt.hamlet b/templates/configurators/pairing/local/prompt.hamlet index 1d27b18379..24de62b1c2 100644 --- a/templates/configurators/pairing/local/prompt.hamlet +++ b/templates/configurators/pairing/local/prompt.hamlet @@ -7,8 +7,8 @@ two git annex repositories will be combined into one, with changes # kept in sync between them. $else - Pairing with #{username}@#{hostname} will combine the two git annex # - repositories into one, with changes kept in sync between them. + Pairing with #{username}@#{hostname} will combine your two git annex # + repositories into one, allowing you to share files.

$if start For security, enter a secret phrase. This same secret phrase will # diff --git a/templates/configurators/pairing/xmpp/end.hamlet b/templates/configurators/pairing/xmpp/end.hamlet index 96a9cb2a0c..ee558e0f52 100644 --- a/templates/configurators/pairing/xmpp/end.hamlet +++ b/templates/configurators/pairing/xmpp/end.hamlet @@ -9,6 +9,8 @@ $nothing A pair request has been sent to all other devices using your jabber # account. + $else + Pair request accepted.

Configure a shared cloud repository $maybe name <- friend