diff options
author | joe <joe@jerkface.net> | 2014-03-08 21:16:18 -0500 |
---|---|---|
committer | joe <joe@jerkface.net> | 2014-03-08 21:16:18 -0500 |
commit | a3382732fb80714113920c699c290c1565d6919b (patch) | |
tree | 9b2257f36505ac437d2f7c07498c27acf47c9518 /Presence/XMPPServer.hs | |
parent | 6ae814b019a2b14848ee376d1f9ea521310ae0cd (diff) |
broadcast roster change to other clients on approve/reject
Diffstat (limited to 'Presence/XMPPServer.hs')
-rw-r--r-- | Presence/XMPPServer.hs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Presence/XMPPServer.hs b/Presence/XMPPServer.hs index 02dd5134..d9cacb4c 100644 --- a/Presence/XMPPServer.hs +++ b/Presence/XMPPServer.hs | |||
@@ -24,6 +24,7 @@ module XMPPServer | |||
24 | , presenceSolicitation | 24 | , presenceSolicitation |
25 | , makePresenceStanza | 25 | , makePresenceStanza |
26 | , makeInformSubscription | 26 | , makeInformSubscription |
27 | , makeRosterUpdate | ||
27 | , JabberShow(..) | 28 | , JabberShow(..) |
28 | ) where | 29 | ) where |
29 | 30 | ||
@@ -794,6 +795,20 @@ makePresenceStanza namespace mjid pstat = do | |||
794 | , EventContent (ContentText stat) | 795 | , EventContent (ContentText stat) |
795 | , EventEndElement "{jabber:client}show" ] | 796 | , EventEndElement "{jabber:client}show" ] |
796 | 797 | ||
798 | makeRosterUpdate tojid contact relationship = do | ||
799 | let attrs = [attr "subscription" relationship] | ||
800 | stanzaFromList Unrecognized | ||
801 | [ EventBeginElement "{jabber:client}iq" | ||
802 | [ attr "to" tojid | ||
803 | , attr "id" "someid" | ||
804 | , attr "type" "set" | ||
805 | ] | ||
806 | , EventBeginElement "{jabber:iq:roster}query" [] | ||
807 | , EventBeginElement "{jabber:iq:roster}item" (attr "jid" contact : attrs) | ||
808 | , EventEndElement "{jabber:iq:roster}item" | ||
809 | , EventEndElement "{jabber:iq:roster}query" | ||
810 | , EventEndElement "{jabber:client}iq" | ||
811 | ] | ||
797 | 812 | ||
798 | makePong :: Text -> Maybe Text -> Text -> Text -> [XML.Event] | 813 | makePong :: Text -> Maybe Text -> Text -> Text -> [XML.Event] |
799 | makePong namespace mid to from = | 814 | makePong namespace mid to from = |