fix redirect from XMPP prompt to pairing pages

This commit is contained in:
Joey Hess 2013-03-16 19:19:58 -04:00
parent 4c0642a70d
commit 0400c5f596
2 changed files with 9 additions and 3 deletions

View file

@ -58,7 +58,10 @@ getStartXMPPPairFriendR = ifM (isJust <$> liftAnnex getXMPPCreds)
liftAssistant $ sendNetMessage QueryPresence liftAssistant $ sendNetMessage QueryPresence
pairPage $ pairPage $
$(widgetFile "configurators/pairing/xmpp/friend/prompt") $(widgetFile "configurators/pairing/xmpp/friend/prompt")
, redirect XMPPR -- go get XMPP configured, then come back , do
-- go get XMPP configured, then come back
setUltDestCurrent
redirect XMPPR
) )
#else #else
getStartXMPPPairFriendR = noXMPPPairing getStartXMPPPairFriendR = noXMPPPairing
@ -71,7 +74,10 @@ getStartXMPPPairSelfR :: Handler RepHtml
#ifdef WITH_XMPP #ifdef WITH_XMPP
getStartXMPPPairSelfR = go =<< liftAnnex getXMPPCreds getStartXMPPPairSelfR = go =<< liftAnnex getXMPPCreds
where where
go Nothing = redirect XMPPR -- go get XMPP configured, then come back go Nothing = do
-- go get XMPP configured, then come back
setUltDestCurrent
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

@ -110,7 +110,7 @@ postXMPPR = xmppPage $ do
storecreds creds = do storecreds creds = do
void $ liftAnnex $ setXMPPCreds creds void $ liftAnnex $ setXMPPCreds creds
liftAssistant notifyNetMessagerRestart liftAssistant notifyNetMessagerRestart
redirectBack redirectUltDest DashboardR
#else #else
getXMPPR = xmppPage $ getXMPPR = xmppPage $
$(widgetFile "configurators/xmpp/disabled") $(widgetFile "configurators/xmpp/disabled")