fix build without XMPP
not sure if I'll keep bothering with this option
This commit is contained in:
parent
a1d58959e4
commit
8fd78f45a2
3 changed files with 15 additions and 14 deletions
|
@ -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")
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue