diff options
author | joe <joe@jerkface.net> | 2013-06-26 15:45:16 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2013-06-26 15:45:16 -0400 |
commit | 5610131fadb45479984da20143cbc87ce0b04a59 (patch) | |
tree | 5a95b87001738df89dabb58c5dcdf2dff8bad6fa | |
parent | 3cd15d1fd7fc1a06f850830e0f03008e1da49f70 (diff) |
comments
-rw-r--r-- | Presence/XMPPServer.hs | 2 | ||||
-rw-r--r-- | Presence/main.hs | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/Presence/XMPPServer.hs b/Presence/XMPPServer.hs index 3413dcfb..54ee0975 100644 --- a/Presence/XMPPServer.hs +++ b/Presence/XMPPServer.hs | |||
@@ -769,5 +769,7 @@ seekRemotePeers config chan = do | |||
769 | forM_ (Set.toList peers) $ \peer -> do | 769 | forM_ (Set.toList peers) $ \peer -> do |
770 | when (is_remote peer) $ | 770 | when (is_remote peer) $ |
771 | liftIO $ sendMessage server_connections (OutBoundPresence p) peer | 771 | liftIO $ sendMessage server_connections (OutBoundPresence p) peer |
772 | -- TODO: send presence probes for buddies | ||
773 | -- TODO: cache remote presences for clients | ||
772 | _ -> return (Just ()) | 774 | _ -> return (Just ()) |
773 | loop | 775 | loop |
diff --git a/Presence/main.hs b/Presence/main.hs index 5897d79e..08943b08 100644 --- a/Presence/main.hs +++ b/Presence/main.hs | |||
@@ -90,7 +90,7 @@ instance XMPPSession UnixSession where | |||
90 | subscribe session Nothing = do | 90 | subscribe session Nothing = do |
91 | let tmvar = localSubscriber (presence_state session) | 91 | let tmvar = localSubscriber (presence_state session) |
92 | atomically $ subscribeToChan tmvar | 92 | atomically $ subscribeToChan tmvar |
93 | subscribe session (Just jid) = do | 93 | subscribe session (Just jid) = do -- UNUSED as yet |
94 | let tvar = subscriberMap (presence_state session) | 94 | let tvar = subscriberMap (presence_state session) |
95 | atomically $ subscribeToMap tvar jid | 95 | atomically $ subscribeToMap tvar jid |
96 | announcePresence session (Presence jid status) = do | 96 | announcePresence session (Presence jid status) = do |
@@ -149,11 +149,12 @@ update_presence locals_greedy subscribers state getStatus = | |||
149 | type RefCount = Int | 149 | type RefCount = Int |
150 | 150 | ||
151 | data PresenceState = PresenceState | 151 | data PresenceState = PresenceState |
152 | { hostname :: Peer -- ByteString | 152 | { hostname :: Peer -- ByteString, TODO: remove this, its always LocalHost now |
153 | , currentTTY :: TVar ByteString | 153 | , currentTTY :: TVar ByteString |
154 | , activeUsers :: TVar (Set JID) | 154 | , activeUsers :: TVar (Set JID) |
155 | , subscriberMap :: TVar (Map JID (RefCount,TChan Presence)) | 155 | , subscriberMap :: TVar (Map JID (RefCount,TChan Presence)) -- UNUSED as yet |
156 | , localSubscriber :: TMVar (RefCount,TChan Presence) | 156 | , localSubscriber :: TMVar (RefCount,TChan Presence) -- TODO: rename this, its not just locals |
157 | -- ... or make a separte channel for remotes | ||
157 | } | 158 | } |
158 | 159 | ||
159 | newPresenceState hostname = atomically $ do | 160 | newPresenceState hostname = atomically $ do |