~singpolyma/cheogram-smtp

9ec1e1eaa3b5c7876241e3a0e8bcd4bff8c696e8 — Stephen Paul Weber 3 years ago 2e20ee0
VCard requset should go to bare JID

Otherwise it is routed to the actual client, which has no idea.
2 files changed, 2 insertions(+), 2 deletions(-)

M VCard.hs
M test/VCardTest.hs
M VCard.hs => VCard.hs +1 -1
@@ 35,7 35,7 @@ emptyVCard = VCard Nothing Nothing []

vcardRequest :: XMPP.JID -> XMPP.IQ
vcardRequest jid = (XMPP.emptyIQ XMPP.IQGet) {
	XMPP.iqTo = Just jid,
	XMPP.iqTo = Just $ bareJid jid,
	XMPP.iqPayload = Just $ XML.Element
		(s"{urn:ietf:params:xml:ns:vcard-4.0}vcard") [] []
}

M test/VCardTest.hs => test/VCardTest.hs +1 -1
@@ 14,7 14,7 @@ import TestInstances ()

prop_vcardRequest :: XMPP.JID -> Bool
prop_vcardRequest jid =
	XMPP.iqTo req == Just jid &&
	XMPP.iqTo req == Just (bareJid jid) &&
	XMPP.iqPayload req == Just vcardEl
	where
	vcardEl = XML.Element (s"{urn:ietf:params:xml:ns:vcard-4.0}vcard") [] []