summaryrefslogtreecommitdiff
path: root/xmppServer.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-03-08 14:44:44 -0500
committerjoe <joe@jerkface.net>2014-03-08 14:44:44 -0500
commit746f78b98d7b02504ea0367f50afa46932ee4917 (patch)
tree6aa526ccdf190a56e21fdedcf8b9c4b08a012106 /xmppServer.hs
parentb867a70b2321065d3d98cb55df96a3083e217018 (diff)
more roster stubs
Diffstat (limited to 'xmppServer.hs')
-rw-r--r--xmppServer.hs13
1 files changed, 12 insertions, 1 deletions
diff --git a/xmppServer.hs b/xmppServer.hs
index 7f610587..d553d1e7 100644
--- a/xmppServer.hs
+++ b/xmppServer.hs
@@ -586,7 +586,6 @@ answerProbe state k stanza chan = do
586 atomically $ writeTChan (connChan conn) pstanza 586 atomically $ writeTChan (connChan conn) pstanza
587 587
588sendCachedPresence state k = do 588sendCachedPresence state k = do
589 -- TODO: send buddies in remotesByPeer
590 forClient state k (return ()) $ \client -> do 589 forClient state k (return ()) $ \client -> do
591 rbp <- atomically $ readTVar (remotesByPeer state) 590 rbp <- atomically $ readTVar (remotesByPeer state)
592 jids <- configText ConfigFiles.getBuddies (clientUser client) 591 jids <- configText ConfigFiles.getBuddies (clientUser client)
@@ -616,6 +615,7 @@ sendCachedPresence state k = do
616clientSubscriptionRequest :: PresenceState -> IO () -> ConnectionKey -> Stanza -> TChan Stanza -> IO () 615clientSubscriptionRequest :: PresenceState -> IO () -> ConnectionKey -> Stanza -> TChan Stanza -> IO ()
617clientSubscriptionRequest state fail k stanza chan = do 616clientSubscriptionRequest state fail k stanza chan = do
618 flip (maybe fail) (stanzaTo stanza) $ \to -> do 617 flip (maybe fail) (stanzaTo stanza) $ \to -> do
618 putStrLn $ "TODO: clientSubscriptionRequest"
619 -- TODO: resolve hostname 619 -- TODO: resolve hostname
620 -- TODO: add to solicited 620 -- TODO: add to solicited
621 -- TODO; if already connected, send solicitation 621 -- TODO; if already connected, send solicitation
@@ -624,6 +624,7 @@ clientSubscriptionRequest state fail k stanza chan = do
624 624
625peerSubscriptionRequest :: PresenceState -> IO () -> ConnectionKey -> Stanza -> TChan Stanza -> IO () 625peerSubscriptionRequest :: PresenceState -> IO () -> ConnectionKey -> Stanza -> TChan Stanza -> IO ()
626peerSubscriptionRequest state fail k stanza chan = do 626peerSubscriptionRequest state fail k stanza chan = do
627 putStrLn $ "TODO: peerSubscriptionRequest"
627 -- TODO: if already subscribed, reply and quit 628 -- TODO: if already subscribed, reply and quit
628 629
629 -- TODO: add to pending 630 -- TODO: add to pending
@@ -640,6 +641,14 @@ peerSubscriptionRequest state fail k stanza chan = do
640 641
641 return () 642 return ()
642 643
644clientInformSubscription state fail k stanza = do
645 putStrLn $ "TODO: clientInformSubscription"
646 return ()
647
648peerInformSubscription state fail k stanza = do
649 putStrLn $ "TODO: peerInformSubscription"
650 return ()
651
643main = runResourceT $ do 652main = runResourceT $ do
644 state <- liftIO . atomically $ do 653 state <- liftIO . atomically $ do
645 clients <- newTVar Map.empty 654 clients <- newTVar Map.empty
@@ -677,6 +686,8 @@ main = runResourceT $ do
677 , xmppAnswerProbe = answerProbe state 686 , xmppAnswerProbe = answerProbe state
678 , xmppClientSubscriptionRequest = clientSubscriptionRequest state 687 , xmppClientSubscriptionRequest = clientSubscriptionRequest state
679 , xmppPeerSubscriptionRequest = peerSubscriptionRequest state 688 , xmppPeerSubscriptionRequest = peerSubscriptionRequest state
689 , xmppClientInformSubscription = clientInformSubscription state
690 , xmppPeerInformSubscription = peerInformSubscription state
680 } 691 }
681 liftIO $ do 692 liftIO $ do
682 atomically $ putTMVar (server state) sv 693 atomically $ putTMVar (server state) sv