From 8fd78f45a2200f58e11bb5ad6e22c39dad7f437e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 12 Nov 2012 01:48:15 -0400 Subject: [PATCH] fix build without XMPP not sure if I'll keep bothering with this option --- Assistant/WebApp/Configurators/Pairing.hs | 12 ++++++------ Assistant/WebApp/Configurators/XMPP.hs | 16 +++++++++------- GitAnnex.hs | 1 - 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Assistant/WebApp/Configurators/Pairing.hs b/Assistant/WebApp/Configurators/Pairing.hs index 1675f572d8..c6e98741bc 100644 --- a/Assistant/WebApp/Configurators/Pairing.hs +++ b/Assistant/WebApp/Configurators/Pairing.hs @@ -12,10 +12,8 @@ module Assistant.WebApp.Configurators.Pairing where import Assistant.Pairing import Assistant.WebApp -import Assistant.WebApp.Configurators import Assistant.WebApp.Types import Assistant.WebApp.SideBar -import Assistant.WebApp.Configurators.XMPP import Assistant.Types.Buddies import Utility.Yesod #ifdef WITH_PAIRING @@ -37,6 +35,8 @@ import Assistant.XMPP.Git import Network.Protocol.XMPP import Assistant.Types.NetMessager import Assistant.NetMessager +import Assistant.WebApp.Configurators +import Assistant.WebApp.Configurators.XMPP #endif import Utility.UserInfo import Git @@ -286,10 +286,6 @@ sampleQuote = T.unwords #else -noPairing :: Text -> Handler RepHtml -noPairing pairingtype = pairPage $ - $(widgetFile "configurators/pairing/disabled") - #endif pairPage :: Widget -> Handler RepHtml @@ -297,3 +293,7 @@ pairPage w = bootstrap (Just Config) $ do sideBarDisplay setTitle "Pairing" w + +noPairing :: Text -> Handler RepHtml +noPairing pairingtype = pairPage $ + $(widgetFile "configurators/pairing/disabled") diff --git a/Assistant/WebApp/Configurators/XMPP.hs b/Assistant/WebApp/Configurators/XMPP.hs index 8cef1f9db9..9d41a85a3d 100644 --- a/Assistant/WebApp/Configurators/XMPP.hs +++ b/Assistant/WebApp/Configurators/XMPP.hs @@ -14,16 +14,16 @@ import Assistant.WebApp import Assistant.WebApp.Types import Assistant.WebApp.Notifications import Assistant.WebApp.SideBar -import Assistant.Types.Buddies -import Assistant.Alert -import Assistant.DaemonStatus import Utility.Yesod import Utility.NotificationBroadcaster -import Assistant.Common #ifdef WITH_XMPP +import Assistant.Common import Assistant.XMPP.Client import Assistant.XMPP.Buddies +import Assistant.Types.Buddies import Assistant.NetMessager +import Assistant.Alert +import Assistant.DaemonStatus import Utility.SRV #endif @@ -37,6 +37,7 @@ import qualified Data.Text as T {- Displays an alert suggesting to configure XMPP, with a button. -} xmppNeeded :: Handler () +#ifdef WITH_XMPP xmppNeeded = whenM (isNothing <$> runAnnex Nothing getXMPPCreds) $ do urlrender <- getUrlRender void $ liftAssistant $ do @@ -46,6 +47,9 @@ xmppNeeded = whenM (isNothing <$> runAnnex Nothing getXMPPCreds) $ do , buttonUrl = urlrender XMPPR , buttonAction = Just close } +#else +xmppNeeded = return () +#endif getXMPPR :: Handler RepHtml #ifdef WITH_XMPP @@ -104,10 +108,8 @@ buddyListDisplay = do let pairedwith = catMaybes $ map (parseJID . getXMPPClientID) rs catMaybes . map (buddySummary pairedwith) <$> (getBuddyList <<~ buddyList) -#else - let buddies = [] -#endif $(widgetFile "configurators/xmpp/buddylist") +#endif where ident = "buddylist" diff --git a/GitAnnex.hs b/GitAnnex.hs index dcde2644c5..81667ee76d 100644 --- a/GitAnnex.hs +++ b/GitAnnex.hs @@ -124,7 +124,6 @@ cmds = concat #ifdef WITH_ASSISTANT , Command.Watch.def , Command.Assistant.def - , Command.XMPPGit.def #ifdef WITH_WEBAPP , Command.WebApp.def #endif