diff --git a/Assistant/WebApp/Configurators/Pairing.hs b/Assistant/WebApp/Configurators/Pairing.hs index 7a98d397fc..624123f17a 100644 --- a/Assistant/WebApp/Configurators/Pairing.hs +++ b/Assistant/WebApp/Configurators/Pairing.hs @@ -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. -} diff --git a/Assistant/WebApp/Configurators/XMPP.hs b/Assistant/WebApp/Configurators/XMPP.hs index 43059854a9..a1b568ccdb 100644 --- a/Assistant/WebApp/Configurators/XMPP.hs +++ b/Assistant/WebApp/Configurators/XMPP.hs @@ -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 diff --git a/Assistant/WebApp/routes b/Assistant/WebApp/routes index fccc82ed16..bae66078fa 100644 --- a/Assistant/WebApp/routes +++ b/Assistant/WebApp/routes @@ -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 diff --git a/templates/configurators/main.hamlet b/templates/configurators/main.hamlet index 54523f9179..a974118acd 100644 --- a/templates/configurators/main.hamlet +++ b/templates/configurators/main.hamlet @@ -16,14 +16,14 @@
$if xmppconfigured

- + Re-configure jabber account

Your jabber account is set up, and will be used to keep # in touch with remote devices, and with your friends. $else

- + Configure jabber account

Keep in touch with remote devices, and with your friends, #