Sending XHTML messages with Strophe in a muc room

cen

New Member
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?\[code\]<message to="[email protected]" 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>\[/code\]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 )\[code\]<iq xmlns="jabber:client" from="[email protected]" 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>\[/code\]Edit2: response to the message stanza\[code\] <message xmlns="jabber:client" from="[email protected]/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>\[/code\]Edit3: response to the muc#traffic query\[code\]<iq xmlns="jabber:client" from="[email protected]" 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>\[/code\]Edit4: Psi response to client (features) disco#info (xhtml-im is the last one)\[code\] <iq xmlns="jabber:client" from="[email protected]/Kostyas-MacBook-Pro" type="result" to="[email protected]/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>\[/code\]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:\[code\]<message xmlns="jabber:client" type="groupchat" to="[email protected]"><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>\[/code\]
 
Back
Top