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

View file

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

View file

@ -15,7 +15,9 @@
/config ConfigurationR GET /config ConfigurationR GET
/config/preferences PreferencesR GET POST /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/xmpp/needcloudrepo/#UUID NeedCloudRepoR GET
/config/addrepository AddRepositoryR GET /config/addrepository AddRepositoryR GET

View file

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