User Control Panel
Advertisements

HELP US, HELP YOU!

html formatting and Net::Jabber

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Jabber Protocol & bots
View unanswered posts
Author Message
drdreff
Newbie
Newbie


Joined: 13 May 2004
Posts: 20

Reputation: 24.5Reputation: 24.5

PostPosted: Tue Jan 11, 2005 10:44 am    Post subject: Reply with quote

The pain of AOL and the stain on my soul has driven me to start moving my bot to a more controllable environment.

Im using Net::Jabber now and I'm having troble creating html formatted messages. The spec says it can be done, but there's not any examples.

Has anyone used Net::Jabber to send html?
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Tue Jan 11, 2005 12:46 pm    Post subject: Reply with quote

I've tested having my bot send HTML to me, but it just shows the actual HTML code and not rendering it.
_________________
Current Site (2008) http://www.cuvou.com/
Back to top
drdreff
Newbie
Newbie


Joined: 13 May 2004
Posts: 20

Reputation: 24.5Reputation: 24.5

PostPosted: Tue Jan 11, 2005 4:08 pm    Post subject: Reply with quote

XMPP Allows for the format to be transmit, but I don't think that Net::Jabber has the code required to support it. Net::XMPP is not that different so maybe we're both looking at the wrong libs.
Back to top
drdreff
Newbie
Newbie


Joined: 13 May 2004
Posts: 20

Reputation: 24.5Reputation: 24.5

PostPosted: Tue Jan 18, 2005 8:25 am    Post subject: Reply with quote

FWIW the way to do this is to craft your own jabber format message and send it using XMLStream's Send().

The Net::Jabber MessageSend has too many limitations to allow for arbitrary xml to be sent.

So I build up a string like:
Code:
<br /><html xmlns="http://www.w3.org/1999/xhtml"><br />  <body><br />    <!-- XHTML-Basic Message here--><br />  </body><br /></html><br />

and later wrap + send it like:
Code:
<br />     $Connection->Send( '<message to="'.$who.'" type="chat">'.<br />                         '<body>Trillian</body>'.$body.'</message>'<br />                       );<br />

Given some extra time and dedication to the task I will use the XML functions to build up that message, but the Send() fires a string down the connection, so you can't just pass it an object anyway.

So there's the answer
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Jabber Protocol & bots All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group