summaryrefslogtreecommitdiff
path: root/Presence/XMPPServer.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-02-16 22:31:49 -0500
committerjoe <joe@jerkface.net>2014-02-16 22:31:49 -0500
commit1ca1927a27ab4200c9a71f2e6ab4fd6be860e92f (patch)
tree67d82e41f3d88a48d9369422cb5a05aa611e54a4 /Presence/XMPPServer.hs
parent0cb2c11613208cbeb8fb012b63b05b8ea4d6da84 (diff)
xmppSubscribeToRoster
Diffstat (limited to 'Presence/XMPPServer.hs')
-rw-r--r--Presence/XMPPServer.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Presence/XMPPServer.hs b/Presence/XMPPServer.hs
index 4c87ba65..83a9fb39 100644
--- a/Presence/XMPPServer.hs
+++ b/Presence/XMPPServer.hs
@@ -128,9 +128,11 @@ data XMPPServerParameters =
128 , xmppRosterSubscribers :: ConnectionKey -> IO [Text] 128 , xmppRosterSubscribers :: ConnectionKey -> IO [Text]
129 , xmppRosterSolicited :: ConnectionKey -> IO [Text] 129 , xmppRosterSolicited :: ConnectionKey -> IO [Text]
130 , xmppRosterOthers :: ConnectionKey -> IO [Text] 130 , xmppRosterOthers :: ConnectionKey -> IO [Text]
131 , xmppSubscribeToRoster :: ConnectionKey -> IO ()
131 , xmppLookupClientJID :: ConnectionKey -> IO Text 132 , xmppLookupClientJID :: ConnectionKey -> IO Text
132 , xmppLookupPeerName :: ConnectionKey -> IO Text 133 , xmppLookupPeerName :: ConnectionKey -> IO Text
133 , xmppDeliverMessage :: (IO ()) -> Stanza -> IO () 134 , xmppDeliverMessage :: (IO ()) -> Stanza -> IO ()
135 , xmppInformClientPresence :: ConnectionKey -> Stanza -> IO ()
134 } 136 }
135 137
136-- TODO: http://xmpp.org/rfcs/rfc6120.html#rules-remote-error 138-- TODO: http://xmpp.org/rfcs/rfc6120.html#rules-remote-error
@@ -797,6 +799,8 @@ sendRoster query xmpp replyto = do
797 799
798socketFromKey :: Server k -> k -> IO Socket 800socketFromKey :: Server k -> k -> IO Socket
799socketFromKey sv k = do 801socketFromKey sv k = do
802 let v = Map.lookup k $ conmap sv
803 flip (maybe $ todo) v $ \_ ->do
800 return todo 804 return todo
801 805
802monitor sv params xmpp = do 806monitor sv params xmpp = do
@@ -835,11 +839,14 @@ monitor sv params xmpp = do
835 SessionRequest -> do 839 SessionRequest -> do
836 let reply = iq_session_reply (stanzaId stanza) "localhost" 840 let reply = iq_session_reply (stanzaId stanza) "localhost"
837 sendReply quitVar Pong reply replyto 841 sendReply quitVar Pong reply replyto
838 RequestRoster -> 842 RequestRoster -> do
839 sendRoster stanza xmpp replyto 843 sendRoster stanza xmpp replyto
844 xmppSubscribeToRoster xmpp k
840 Message {} -> do 845 Message {} -> do
841 let fail = return () -- todo 846 let fail = return () -- todo
842 xmppDeliverMessage xmpp fail stanza 847 xmppDeliverMessage xmpp fail stanza
848 PresenceStatus {} -> do
849 xmppInformClientPresence xmpp k stanza
843 UnrecognizedQuery query -> do 850 UnrecognizedQuery query -> do
844 let reply = iq_service_unavailable (stanzaId stanza) "localhost" query 851 let reply = iq_service_unavailable (stanzaId stanza) "localhost" query
845 sendReply quitVar Error reply replyto 852 sendReply quitVar Error reply replyto