diff options
Diffstat (limited to 'Presence')
-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 |