aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Assistant/Threads/PushNotifier.hs6
-rw-r--r--Assistant/Threads/WebApp.hs1
-rw-r--r--Utility/SRV.hs3
3 files changed, 6 insertions, 4 deletions
diff --git a/Assistant/Threads/PushNotifier.hs b/Assistant/Threads/PushNotifier.hs
index 0686aac7b..4ba8d677b 100644
--- a/Assistant/Threads/PushNotifier.hs
+++ b/Assistant/Threads/PushNotifier.hs
@@ -35,8 +35,7 @@ pushNotifierThread :: ThreadState -> DaemonStatusHandle -> PushNotifier -> Named
pushNotifierThread st dstatus pushnotifier = NamedThread thisThread $ do
v <- runThreadState st $ getXMPPCreds
case v of
- Nothing -> do
- return () -- no creds? exit thread
+ Nothing -> return () -- no creds? exit thread
Just c -> void $ connectXMPP c $ \jid -> do
fulljid <- bindJID jid
liftIO $ debug thisThread ["XMPP connected", show fulljid]
@@ -83,7 +82,8 @@ connectXMPP c a = case parseJID (xmppJID c) of
connectXMPP' :: JID -> XMPPCreds -> (JID -> XMPP a) -> IO (Either SomeException ())
connectXMPP' jid c a = go =<< lookupSRV srvrecord
where
- srvrecord = mkSRVTcp "xmpp-client" (T.unpack $ strDomain $ jidDomain jid)
+ srvrecord = mkSRVTcp "xmpp-client" $
+ T.unpack $ strDomain $ jidDomain jid
serverjid = JID Nothing (jidDomain jid) Nothing
go [] = run (xmppHostname c)
diff --git a/Assistant/Threads/WebApp.hs b/Assistant/Threads/WebApp.hs
index c33dc2103..5eda88d36 100644
--- a/Assistant/Threads/WebApp.hs
+++ b/Assistant/Threads/WebApp.hs
@@ -24,6 +24,7 @@ import Assistant.WebApp.Configurators.Pairing
#ifdef WITH_S3
import Assistant.WebApp.Configurators.S3
#endif
+import Assistant.WebApp.Configurators.XMPP
import Assistant.WebApp.Documentation
import Assistant.WebApp.OtherRepos
import Assistant.ThreadedMonad
diff --git a/Utility/SRV.hs b/Utility/SRV.hs
index 38ac28787..4f2db680b 100644
--- a/Utility/SRV.hs
+++ b/Utility/SRV.hs
@@ -33,12 +33,13 @@ import Data.Either
#endif
newtype SRV = SRV String
+ deriving (Show, Eq)
type HostPort = (HostName, PortID)
mkSRV :: String -> String -> HostName -> SRV
mkSRV transport protocol host = SRV $ concat
- ["_", protocol, ".", transport, ".", host]
+ ["_", protocol, "._", transport, ".", host]
mkSRVTcp :: String -> HostName -> SRV
mkSRVTcp = mkSRV "tcp"