~singpolyma/cheogram-smtp

91b56cb3edd7d5ebcbb0c11c5deca40deb4bd87d — Stephen Paul Weber 3 years ago 06e9542
vcard-temp for the gateway

Includes needed license information.
1 files changed, 16 insertions(+), 1 deletions(-)

M gateway.hs
M gateway.hs => gateway.hs +16 -1
@@ 132,7 132,6 @@ messageErrorHandler replyMap message = do

iqGetHandler :: XMPP.IQ -> XMPP.XMPP ()
iqGetHandler iq@XMPP.IQ {
	XMPP.iqType = XMPP.IQGet,
	XMPP.iqTo = Just to,
	XMPP.iqPayload = Just p
} | Nothing <- XMPP.jidNode to,


@@ 147,6 146,22 @@ iqGetHandler iq@XMPP.IQ {
	where
	nodeAttribute = fmap (\node -> (s"node", [XML.ContentText node])) $
		XML.attributeText (s"node") p
iqGetHandler iq@XMPP.IQ {
	XMPP.iqTo = Just to,
	XMPP.iqPayload = Just p
} | Nothing <- XMPP.jidNode to,
    [_] <- XML.isNamed (s"{vcard-temp}vCard") p =
	XMPP.putStanza $ flip iqReply iq $ Just $ XML.Element
		(s"{vcard-temp}vCard") [] [
			XML.NodeElement $ mkElement (s"{vcard-temp}URL")
				(s"https://smtp.cheogram.com"),
			XML.NodeElement $ mkElement (s"{vcard-temp}DESC") (s"\
				\A bidirectional gateway between XMPP and SMTP.\
				\\n\nLicensed under AGPLv3+.\n\nSource code \
				\for this gateway is available from \
				\the listed homepage.\n\n\
				\Part of the Soprani.ca project.")
		]
iqGetHandler iq = XMPP.putStanza $ iqError notImplemented iq

main :: IO ()