summaryrefslogtreecommitdiff
path: root/Presence/XMPPServer.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Presence/XMPPServer.hs')
-rw-r--r--Presence/XMPPServer.hs10
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 =
759mkname :: Text -> Text -> XML.Name 760mkname :: Text -> Text -> XML.Name
760mkname namespace name = (Name name (Just namespace) Nothing) 761mkname namespace name = (Name name (Just namespace) Nothing)
761 762
763makeInformSubscription 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
762makePresenceStanza namespace mjid pstat = do 772makePresenceStanza namespace mjid pstat = do
763 stanzaFromList PresenceStatus { presenceShow = pstat 773 stanzaFromList PresenceStatus { presenceShow = pstat
764 , presencePriority = Nothing 774 , presencePriority = Nothing