summaryrefslogtreecommitdiff
path: root/xmppServer.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-03-08 19:24:27 -0500
committerjoe <joe@jerkface.net>2014-03-08 19:24:27 -0500
commit6a56c60d1c4995878e09fbdecab081e549521b8b (patch)
tree0f4a40dac29ee80d0433acfb31380012837b08c5 /xmppServer.hs
parent24d6b90cfd491a0f28f305bd7c8d0395d01c494f (diff)
todo coment outline to complete roster logic
Diffstat (limited to 'xmppServer.hs')
-rw-r--r--xmppServer.hs25
1 files changed, 24 insertions, 1 deletions
diff --git a/xmppServer.hs b/xmppServer.hs
index c781baf9..99d5a197 100644
--- a/xmppServer.hs
+++ b/xmppServer.hs
@@ -662,7 +662,7 @@ clientSubscriptionRequest state fail k stanza chan = do
662 662
663peerSubscriptionRequest :: PresenceState -> IO () -> ConnectionKey -> Stanza -> TChan Stanza -> IO () 663peerSubscriptionRequest :: PresenceState -> IO () -> ConnectionKey -> Stanza -> TChan Stanza -> IO ()
664peerSubscriptionRequest state fail k stanza chan = do 664peerSubscriptionRequest state fail k stanza chan = do
665 putStrLn $ "TODO: peerSubscriptionRequest" 665 putStrLn $ "Handling pending subscription from remote"
666 flip (maybe fail) (stanzaFrom stanza) $ \from -> do 666 flip (maybe fail) (stanzaFrom stanza) $ \from -> do
667 flip (maybe fail) (stanzaTo stanza) $ \to -> do 667 flip (maybe fail) (stanzaTo stanza) $ \to -> do
668 let (mto_u,h,_) = splitJID to 668 let (mto_u,h,_) = splitJID to
@@ -694,6 +694,9 @@ peerSubscriptionRequest state fail k stanza chan = do
694 reply <- makeInformSubscription "jabber:server" to from True 694 reply <- makeInformSubscription "jabber:server" to from True
695 sendModifiedStanzaToPeer reply chan 695 sendModifiedStanzaToPeer reply chan
696 else do 696 else do
697
698 -- TODO: if peer-connection is to self, then auto-approve local user.
699
697 -- Catch exception in case the user does not exist 700 -- Catch exception in case the user does not exist
698 handle (\e -> let _ = isDoesNotExistError e in fail) $ do 701 handle (\e -> let _ = isDoesNotExistError e in fail) $ do
699 -- add from-address to to's pending 702 -- add from-address to to's pending
@@ -720,10 +723,30 @@ peerSubscriptionRequest state fail k stanza chan = do
720 723
721clientInformSubscription state fail k stanza = do 724clientInformSubscription state fail k stanza = do
722 putStrLn $ "TODO: clientInformSubscription" 725 putStrLn $ "TODO: clientInformSubscription"
726 -- approval:
727 -- add to subscribers
728 -- remove from pending
729 -- remove from others
730 -- rejection:
731 -- add to others
732 -- remove from pending
733 -- remove from subscribers
734 --
735 -- send roster update to clients
736 -- notify peer
723 return () 737 return ()
724 738
725peerInformSubscription state fail k stanza = do 739peerInformSubscription state fail k stanza = do
726 putStrLn $ "TODO: peerInformSubscription" 740 putStrLn $ "TODO: peerInformSubscription"
741 -- remove from solicited
742 -- if it was in solicited:
743 -- approval:
744 -- add to buddies
745 -- remove from others
746 -- rejection:
747 -- remove from buddies
748 -- add to others
749 -- send update to clients
727 return () 750 return ()
728 751
729main = runResourceT $ do 752main = runResourceT $ do