diff options
author | joe <joe@jerkface.net> | 2014-03-08 18:48:14 -0500 |
---|---|---|
committer | joe <joe@jerkface.net> | 2014-03-08 18:48:14 -0500 |
commit | 24d6b90cfd491a0f28f305bd7c8d0395d01c494f (patch) | |
tree | e3e118fc3834d64c8076387944ed77a3db622bc6 /Presence/XMPPServer.hs | |
parent | 98187c0b0024148620dad35f057b29160103a95d (diff) |
peerSubscriptionRequest
Diffstat (limited to 'Presence/XMPPServer.hs')
-rw-r--r-- | Presence/XMPPServer.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Presence/XMPPServer.hs b/Presence/XMPPServer.hs index a61601ef..02dd5134 100644 --- a/Presence/XMPPServer.hs +++ b/Presence/XMPPServer.hs | |||
@@ -23,6 +23,7 @@ module XMPPServer | |||
23 | , presenceProbe | 23 | , presenceProbe |
24 | , presenceSolicitation | 24 | , presenceSolicitation |
25 | , makePresenceStanza | 25 | , makePresenceStanza |
26 | , makeInformSubscription | ||
26 | , JabberShow(..) | 27 | , JabberShow(..) |
27 | ) where | 28 | ) where |
28 | 29 | ||
@@ -759,6 +760,15 @@ grokStanza "jabber:client" stanzaTag = | |||
759 | mkname :: Text -> Text -> XML.Name | 760 | mkname :: Text -> Text -> XML.Name |
760 | mkname namespace name = (Name name (Just namespace) Nothing) | 761 | mkname namespace name = (Name name (Just namespace) Nothing) |
761 | 762 | ||
763 | makeInformSubscription namespace from to approved = | ||
764 | stanzaFromList (PresenceInformSubscription approved) | ||
765 | $ [ EventBeginElement (mkname namespace "presence") | ||
766 | [ attr "from" from | ||
767 | , attr "to" to | ||
768 | , attr "type" $ if approved then "subscribed" | ||
769 | else "unsubscribed" ] | ||
770 | , EventEndElement (mkname namespace "presence")] | ||
771 | |||
762 | makePresenceStanza namespace mjid pstat = do | 772 | makePresenceStanza namespace mjid pstat = do |
763 | stanzaFromList PresenceStatus { presenceShow = pstat | 773 | stanzaFromList PresenceStatus { presenceShow = pstat |
764 | , presencePriority = Nothing | 774 | , presencePriority = Nothing |