I’m trying to send a html message using Strophe to a muc room. I also tried to send the following xml over the XML console in Psi but it doesn’t work, only Hello World is displayed. Is there something wrong with the message stanza?
<message to="room@conference.server" type="groupchat"><body>Hello World </body><html xmlns="http://jabber.org/protocols/xhtml-im"><body xmlns="http://www.w3.org/1999/xhtml"><p style="color : red">Hello HTML World</p></body></html></message>
Thanks!
Edit1: disco#info room query. I’m using Vacuum-IM and Psi clients now, but Psi should support xhtml-im ( http://psi-im.org/wiki/Supported_Protocols )
<iq xmlns="jabber:client" from="room@conference.server" type="result" id="foo" to="admin@server/Vacuum-IM">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity xmlns="http://jabber.org/protocol/disco#info" category="conference" type="text" name="room"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://jabber.org/protocol/muc"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="muc_public"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="muc_open"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="muc_moderated"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="muc_semianonymous"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="muc_unsecured"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="muc_persistent"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://jabber.org/protocol/disco#info"/>
<x xmlns="jabber:x:data" type="result">
<field xmlns="jabber:x:data" type="hidden" var="FORM_TYPE">
<value xmlns="jabber:x:data">http://jabber.org/protocol/muc#roominfo</value>
</field>
<field xmlns="jabber:x:data" label="Description" var="muc#roominfo_description">
<value xmlns="jabber:x:data">asdf</value>
</field>
<field xmlns="jabber:x:data" label="Subject" var="muc#roominfo_subject">
<value xmlns="jabber:x:data"/>
</field>
<field xmlns="jabber:x:data" label="Number of occupants" var="muc#roominfo_occupants">
<value xmlns="jabber:x:data">1</value>
</field>
<field xmlns="jabber:x:data" label="Creation date" var="x-muc#roominfo_creationdate">
<value xmlns="jabber:x:data">20120423T17:31:49</value>
</field>
</x>
</query>
Edit2: response to the message stanza
<message xmlns="jabber:client" from="room@conference.server/ad" type="groupchat" to="admin@server/Vacuum-IM">
<body xmlns="jabber:client">Hello World </body>
<html xmlns="http://jabber.org/protocols/xhtml-im">
<body xmlns="http://www.w3.org/1999/xhtml">
<p xmlns="http://www.w3.org/1999/xhtml" style="color : red">Hello HTML World</p>
</body>
</html>
Edit3: response to the muc#traffic query
<iq xmlns="jabber:client" from="room@conference.server" type="error" id="foo" to="admin@server/Vacuum-IM">
<query xmlns="http://jabber.org/protocol/disco#info" node="http://jabber.org/protocol/muc#traffic"/>
<error xmlns="jabber:client" type="cancel" code="404">
<item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
Edit4: Psi response to client (features) disco#info (xhtml-im is the last one)
<iq xmlns="jabber:client" from="admin@kossy.local/Kostyas-MacBook-Pro" type="result" to="admin@kossy.local/Vacuum-IM" id="foo">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity xmlns="http://jabber.org/protocol/disco#info" category="client" type="pc" name="Psi"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://jabber.org/protocol/bytestreams"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://jabber.org/protocol/si"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://jabber.org/protocol/si/profile/file-transfer"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://jabber.org/protocol/disco#info"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://jabber.org/protocol/commands"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://jabber.org/protocol/rosterx"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://jabber.org/protocol/muc"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="jabber:x:data"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="urn:xmpp:jingle:1"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="urn:xmpp:jingle:transports:ice-udp:1"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="urn:xmpp:jingle:apps:rtp:1"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="urn:xmpp:jingle:apps:rtp:audio"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://jabber.org/protocol/chatstates"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://jabber.org/protocol/mood+notify"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://jabber.org/protocol/tune+notify"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://jabber.org/protocol/physloc+notify"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://jabber.org/protocol/geoloc+notify"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://www.xmpp.org/extensions/xep-0084.html#ns-metadata+notify"/>
<feature xmlns="http://jabber.org/protocol/disco#info" var="http://jabber.org/protocol/xhtml-im"/>
</query>
Edit5: Solution: Get iChat and Adium 🙂 Adium sends the xhtml messages in different colors and fonts, but it doesn’t display what it has done itself though. Only iChat renders the xhtml properly. So the combination works. Also don’t use p tag and colors should be in hexadecimal form. Example:
<message xmlns="jabber:client" type="groupchat" to="room@conference.server">
<body xmlns="jabber:client">Hello World</body>
<html xmlns="http://jabber.org/protocol/xhtml-im">
<body xmlns="http://www.w3.org/1999/xhtml">
<span xmlns="http://www.w3.org/1999/xhtml" style="font-family: Times New Roman; font-size: large; color: #FF0000;">Red text</span>
</body>
</html>
Psi doesn’t, as far as I know, support XHTML-IM. Such clients will only display the normal
<body>contents.Your example stanza is correct though, so it is either as ggozad suggests, the server removing it (some servers can be configured to do this), or it is simply the client not rendering it.
Try checking in the XML console of a receiving client to see if the
<html>child element is still there after the MUC has broadcast the message.