add a yes/no confirm for xmpp pairing requests
This commit is contained in:
parent
9f5b23d49f
commit
8b22bd8831
5 changed files with 18 additions and 4 deletions
|
@ -222,7 +222,7 @@ pairMsgReceived urlrenderer PairReq theiruuid selfjid theirjid
|
||||||
finishXMPPPairing theirjid theiruuid
|
finishXMPPPairing theirjid theiruuid
|
||||||
-- Show an alert to let the user decide if they want to pair.
|
-- Show an alert to let the user decide if they want to pair.
|
||||||
showalert = do
|
showalert = do
|
||||||
let route = FinishXMPPPairR (PairKey theiruuid $ formatJID theirjid)
|
let route = ConfirmXMPPPairR (PairKey theiruuid $ formatJID theirjid)
|
||||||
url <- liftIO $ renderUrl urlrenderer route []
|
url <- liftIO $ renderUrl urlrenderer route []
|
||||||
close <- asIO1 removeAlert
|
close <- asIO1 removeAlert
|
||||||
void $ addAlert $ pairRequestReceivedAlert (T.unpack $ buddyName theirjid)
|
void $ addAlert $ pairRequestReceivedAlert (T.unpack $ buddyName theirjid)
|
||||||
|
|
|
@ -128,6 +128,17 @@ getFinishLocalPairR msg = promptSecret (Just msg) $ \_ secret -> do
|
||||||
getFinishLocalPairR _ = noLocalPairing
|
getFinishLocalPairR _ = noLocalPairing
|
||||||
#endif
|
#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
|
getFinishXMPPPairR :: PairKey -> Handler RepHtml
|
||||||
#ifdef WITH_XMPP
|
#ifdef WITH_XMPP
|
||||||
getFinishXMPPPairR (PairKey theiruuid t) = case parseJID t of
|
getFinishXMPPPairR (PairKey theiruuid t) = case parseJID t of
|
||||||
|
@ -140,7 +151,7 @@ getFinishXMPPPairR (PairKey theiruuid t) = case parseJID t of
|
||||||
finishXMPPPairing theirjid theiruuid
|
finishXMPPPairing theirjid theiruuid
|
||||||
xmppPairEnd False $ Just theirjid
|
xmppPairEnd False $ Just theirjid
|
||||||
#else
|
#else
|
||||||
getFinishXMPPPairR _ _ = noXMPPPairing
|
getFinishXMPPPairR _ = noXMPPPairing
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WITH_XMPP
|
#ifdef WITH_XMPP
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
/config/repository/pair/local/finish/#PairMsg FinishLocalPairR GET
|
/config/repository/pair/local/finish/#PairMsg FinishLocalPairR GET
|
||||||
/config/repository/pair/xmpp/start StartXMPPPairR GET
|
/config/repository/pair/xmpp/start StartXMPPPairR GET
|
||||||
/config/repository/pair/xmpp/running/#BuddyKey RunningXMPPPairR 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/pair/xmpp/finish/#PairKey FinishXMPPPairR GET
|
||||||
|
|
||||||
/config/repository/enable/rsync/#UUID EnableRsyncR GET
|
/config/repository/enable/rsync/#UUID EnableRsyncR GET
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
two git annex repositories will be combined into one, with changes #
|
two git annex repositories will be combined into one, with changes #
|
||||||
kept in sync between them.
|
kept in sync between them.
|
||||||
$else
|
$else
|
||||||
Pairing with #{username}@#{hostname} will combine the two git annex #
|
Pairing with #{username}@#{hostname} will combine your two git annex #
|
||||||
repositories into one, with changes kept in sync between them.
|
repositories into one, allowing you to share files.
|
||||||
<p>
|
<p>
|
||||||
$if start
|
$if start
|
||||||
For security, enter a secret phrase. This same secret phrase will #
|
For security, enter a secret phrase. This same secret phrase will #
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
$nothing
|
$nothing
|
||||||
A pair request has been sent to all other devices using your jabber #
|
A pair request has been sent to all other devices using your jabber #
|
||||||
account.
|
account.
|
||||||
|
$else
|
||||||
|
Pair request accepted.
|
||||||
<h2>
|
<h2>
|
||||||
Configure a shared cloud repository
|
Configure a shared cloud repository
|
||||||
$maybe name <- friend
|
$maybe name <- friend
|
||||||
|
|
Loading…
Reference in a new issue