stop using UltDest, doesn't seem to reliably work

This commit is contained in:
Joey Hess 2013-04-30 15:19:16 -04:00
parent 9249c324f4
commit 017f62654f
4 changed files with 30 additions and 14 deletions

View file

@ -60,8 +60,7 @@ getStartXMPPPairFriendR = ifM (isJust <$> liftAnnex getXMPPCreds)
$(widgetFile "configurators/pairing/xmpp/friend/prompt")
, do
-- go get XMPP configured, then come back
setUltDestCurrent
redirect XMPPR
redirect XMPPConfigForPairFriendR
)
#else
getStartXMPPPairFriendR = noXMPPPairing
@ -76,8 +75,7 @@ getStartXMPPPairSelfR = go =<< liftAnnex getXMPPCreds
where
go Nothing = do
-- go get XMPP configured, then come back
setUltDestCurrent
redirect XMPPR
redirect XMPPConfigForPairSelfR
go (Just creds) = do
{- Ask buddies to send presence info, to get
- the buddy list populated. -}

View file

@ -43,7 +43,7 @@ xmppNeeded = whenM (isNothing <$> liftAnnex getXMPPCreds) $ do
close <- asIO1 removeAlert
addAlert $ xmppNeededAlert $ AlertButton
{ buttonLabel = "Configure a Jabber account"
, buttonUrl = urlrender XMPPR
, buttonUrl = urlrender XMPPConfigR
, buttonAction = Just close
}
#else
@ -91,11 +91,27 @@ getNeedCloudRepoR _ = xmppPage $
$(widgetFile "configurators/xmpp/disabled")
#endif
getXMPPR :: Handler RepHtml
getXMPPR = postXMPPR
postXMPPR :: Handler RepHtml
getXMPPConfigR :: Handler RepHtml
getXMPPConfigR = postXMPPConfigR
postXMPPConfigR :: Handler RepHtml
postXMPPConfigR = xmppform DashboardR
getXMPPConfigForPairFriendR :: Handler RepHtml
getXMPPConfigForPairFriendR = postXMPPConfigForPairFriendR
postXMPPConfigForPairFriendR :: Handler RepHtml
postXMPPConfigForPairFriendR = xmppform StartXMPPPairFriendR
getXMPPConfigForPairSelfR :: Handler RepHtml
getXMPPConfigForPairSelfR = postXMPPConfigForPairSelfR
postXMPPConfigForPairSelfR :: Handler RepHtml
postXMPPConfigForPairSelfR = xmppform StartXMPPPairSelfR
xmppform :: Route WebApp -> Handler RepHtml
#ifdef WITH_XMPP
postXMPPR = xmppPage $ do
xmppform next = xmppPage $ do
((result, form), enctype) <- lift $ do
oldcreds <- liftAnnex getXMPPCreds
runFormPost $ renderBootstrap $ xmppAForm $
@ -109,9 +125,9 @@ postXMPPR = xmppPage $ do
storecreds creds = do
void $ liftAnnex $ setXMPPCreds creds
liftAssistant notifyNetMessagerRestart
redirectUltDest DashboardR
redirect next
#else
postXMPPR = xmppPage $
xmppform = xmppPage $
$(widgetFile "configurators/xmpp/disabled")
#endif

View file

@ -15,7 +15,9 @@
/config ConfigurationR GET
/config/preferences PreferencesR GET POST
/config/xmpp XMPPR GET POST
/config/xmpp XMPPConfigR GET POST
/config/xmpp/for/self XMPPConfigForPairSelfR GET POST
/config/xmpp/for/frield XMPPConfigForPairFriendR GET POST
/config/xmpp/needcloudrepo/#UUID NeedCloudRepoR GET
/config/addrepository AddRepositoryR GET

View file

@ -16,14 +16,14 @@
<div .span4>
$if xmppconfigured
<h3>
<a href="@{XMPPR}">
<a href="@{XMPPConfigR}">
Re-configure jabber account
<p>
Your jabber account is set up, and will be used to keep #
in touch with remote devices, and with your friends.
$else
<h3>
<a href="@{XMPPR}">
<a href="@{XMPPConfigR}">
Configure jabber account
<p>
Keep in touch with remote devices, and with your friends, #