summaryrefslogtreecommitdiff
path: root/Presence/Presence.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2018-05-18 23:16:46 -0400
committerjoe <joe@jerkface.net>2018-05-18 23:16:46 -0400
commitea3c97cea6cb2a690afca743fa8fecfbb533d69b (patch)
tree463c0ad5176f9978c8f1732069dfdb82f610e937 /Presence/Presence.hs
parent6eefc1e5112753a9f01396e6ba54dca0b7f56c04 (diff)
Daemon options to enable or disable XMPP.
Diffstat (limited to 'Presence/Presence.hs')
-rw-r--r--Presence/Presence.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Presence/Presence.hs b/Presence/Presence.hs
index c556a170..97b9d5b8 100644
--- a/Presence/Presence.hs
+++ b/Presence/Presence.hs
@@ -13,7 +13,7 @@ import Control.Concurrent.STM.TMVar
13import Control.Monad.Trans.Resource (runResourceT) 13import Control.Monad.Trans.Resource (runResourceT)
14import Control.Monad.Trans 14import Control.Monad.Trans
15import Control.Monad.IO.Class (MonadIO, liftIO) 15import Control.Monad.IO.Class (MonadIO, liftIO)
16import Network.Socket ( SockAddr(..) ) 16import Network.Socket ( SockAddr(..), PortNumber )
17import System.Endian (fromBE32) 17import System.Endian (fromBE32)
18import Data.List (nub, (\\), intersect, groupBy, sort, sortBy ) 18import Data.List (nub, (\\), intersect, groupBy, sort, sortBy )
19import Data.Ord (comparing ) 19import Data.Ord (comparing )
@@ -124,8 +124,8 @@ newPresenceState cw toxman xmpp = atomically $ do
124 } 124 }
125 125
126 126
127presenceHooks :: PresenceState -> Int -> XMPPServerParameters 127presenceHooks :: PresenceState -> Int -> Maybe PortNumber -> XMPPServerParameters
128presenceHooks state verbosity = XMPPServerParameters 128presenceHooks state verbosity mport = XMPPServerParameters
129 { xmppChooseResourceName = chooseResourceName state 129 { xmppChooseResourceName = chooseResourceName state
130 , xmppTellClientHisName = tellClientHisName state 130 , xmppTellClientHisName = tellClientHisName state
131 , xmppTellMyNameToClient = textHostName 131 , xmppTellMyNameToClient = textHostName
@@ -148,6 +148,7 @@ presenceHooks state verbosity = XMPPServerParameters
148 , xmppClientInformSubscription = clientInformSubscription state 148 , xmppClientInformSubscription = clientInformSubscription state
149 , xmppPeerInformSubscription = peerInformSubscription state 149 , xmppPeerInformSubscription = peerInformSubscription state
150 , xmppVerbosity = return verbosity 150 , xmppVerbosity = return verbosity
151 , xmppClientPort = fromMaybe 5222 mport
151 } 152 }
152 153
153 154