summaryrefslogtreecommitdiff
path: root/Presence/main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Presence/main.hs')
-rw-r--r--Presence/main.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Presence/main.hs b/Presence/main.hs
index ed247bca..24d240cd 100644
--- a/Presence/main.hs
+++ b/Presence/main.hs
@@ -52,7 +52,7 @@ import qualified Text.Show.ByteString as L
52 52
53 53
54data UnixSession = UnixSession { 54data UnixSession = UnixSession {
55 localhost :: ByteString, 55 localhost :: Peer, -- ByteString,
56 unix_uid :: (IORef (Maybe UserID)), 56 unix_uid :: (IORef (Maybe UserID)),
57 unix_resource :: (IORef (Maybe L.ByteString)), 57 unix_resource :: (IORef (Maybe L.ByteString)),
58 presence_state :: PresenceState 58 presence_state :: PresenceState
@@ -145,7 +145,7 @@ update_presence locals_greedy subscribers state getStatus =
145type RefCount = Int 145type RefCount = Int
146 146
147data PresenceState = PresenceState 147data PresenceState = PresenceState
148 { hostname :: ByteString 148 { hostname :: Peer -- ByteString
149 , currentTTY :: TVar ByteString 149 , currentTTY :: TVar ByteString
150 , activeUsers :: TVar (Set JID) 150 , activeUsers :: TVar (Set JID)
151 , subscriberMap :: TVar (Map JID (RefCount,TChan Presence)) 151 , subscriberMap :: TVar (Map JID (RefCount,TChan Presence))
@@ -200,12 +200,13 @@ instance XMPPConfig UnixConfig where
200 200
201start :: ByteString -> IO () 201start :: ByteString -> IO ()
202start host = do 202start host = do
203 let host = LocalHost
203 tracked <- newPresenceState host 204 tracked <- newPresenceState host
204 let dologin e = track_login host tracked e 205 let dologin e = track_login host tracked e
205 dologin :: t -> IO () 206 dologin :: t -> IO ()
206 207
207 chan <- atomically $ subscribeToChan (localSubscriber tracked) 208 chan <- atomically $ subscribeToChan (localSubscriber tracked)
208 remotes <- forkIO $ seekRemotePeers (/=host) UnixConfig chan 209 remotes <- forkIO $ seekRemotePeers UnixConfig chan
209 210
210 installHandler sigUSR1 (Catch (dologin (userError "signaled"))) Nothing 211 installHandler sigUSR1 (Catch (dologin (userError "signaled"))) Nothing
211 -- installHandler sigTERM (CatchOnce (dologin (userError "term signaled"))) Nothing 212 -- installHandler sigTERM (CatchOnce (dologin (userError "term signaled"))) Nothing