module Network.XMPP.XEP.Version
( isVersionReq
, versionAnswer
) where
import Network.XMPP.Stanza
import Network.XMPP.Stream
import Network.XMPP.Types
import Network.XMPP.Print
import Network.XMPP.JID
import Network.XMPP.Utils
import Text.XML.HaXml
import Text.XML.HaXml.Posn
isVersionReq :: Stanza -> Bool
isVersionReq (IQ { iqBody = ext }) =
isVal "jabber:iq:version" "/iq/query/@xmlns" ext
isVersionReq _ = False
versionAnswer :: String -> String -> String -> (Stanza -> [CFilter i])
versionAnswer name version os s@(IQ { }) =
[ ptag "query"
[ xmlns "jabber:iq:version" ]
[ ptag "name" [] [literal name],
ptag "version" [] [literal version],
ptag "os" [] [literal os]
]
]