diff options
Diffstat (limited to 'Presence/XMPPServer.hs')
-rw-r--r-- | Presence/XMPPServer.hs | 9 |
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 | ||
798 | socketFromKey :: Server k -> k -> IO Socket | 800 | socketFromKey :: Server k -> k -> IO Socket |
799 | socketFromKey sv k = do | 801 | socketFromKey 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 | ||
802 | monitor sv params xmpp = do | 806 | monitor 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 |