XHTML content not persisted in group chat

Hi guys!

I am working on a project that sends messages to an OpenFire group chat, and I have come across a slight problem. If I send a message that contains e.g. a HTML link in XHTML, only the text-only version is persisted in the OpenFire database.

All the other users in the chat receive the XHTML version at first, but when logging out of the chat and logging in again, this may or may not be in XHTML. It all seems to depend on whether or not the message is still in the OpenFire cache. If it has to fetch it from the database, the XHTML is stripped out.

I realize this may be the way the system is intended to work, and that XHTML adds more processing and network traffic, but I still find the behaviour slightly inconsistent.

I have tested this on OpenFire 3.6.4, running both Pidgin 2.5.5 and my own bot (using Smack 3.1.0), and the results are the same. I can reproduce it the following way:

  1. Send an XHTML message to a group chat.
  2. Wait 300 seconds for the data to be flushed to the DB.
  3. Restart OpenFire.
  4. Join the group chat again using Pidgin, and take a look at the retrieved history. The XHTML version is not there anymore.

If there are any tricks to get this working, I’d be very happy :slight_smile:

Kind regards,
Reidar

Hi,

What you describe is the normal behaviour. If the messages need to be pulled from the database to build the chatroom history, the XHTML variant is lost.

daryl

Thanks for your answer Daryl.

It’s good to get a confirmation that this is normal bahaviour. However, I still think the behaviour is inconsistent, as there is no way of knowing whether the server is going to return the complete message, or just the text-only version. It all depends on the size of the cache and whether or not the server is restarted or not.

Regards,
Reidar