Message sent without body not getting into offline user whever it's online

Hello @all

Good morning!!

I am stuck in one issue regarding XMPP Chat.

Whenever i will send message without body and other user is offline then messages are lost and unable to get those messages.

I have tried many thing but couldn’t find any solution.

If anyone knows the solution then please contact me as soon as possible.

Can we need to change any openfire admin panel…?

Thanks in advance.

Messages without a body are not considered chat messages. They won’t be archived or stored. They are considered real-time messages and if there is no recipient, they will be discarded.

What exactly are you trying to achieve?

Thanks Dele_Olajide,

I’m trying to developed delete chat message functionality like whatsapp.

ex:-
if user A delete message from his screen then also delete those message from others user screen also.

Thanks & Regards,
Jayram Desai

You can try to implement this new specification for message retraction

https://xmpp.org/extensions/inbox/message-retraction.html

It is a simple message that will be sent to all clients to remove the previous message. However, it won’t be stored and has to be handled by online users. Offline users will not receive it. Also, you need to find the old message in the archive and delete it to prevent offline users retrieving in via chat history when they come online.

I don’t think this is correct. As per XEP-0160: Best Practices for Handling Offline Messages all “normal” and nearly all “chat” messages should be stored.

We had this issue once already:
https://issues.igniterealtime.org/browse/OF-722
https://issues.igniterealtime.org/browse/OF-633

And actually it worked. Either it broke again with a recent Openfire version or you are using an old version (<3.9.2)

1 Like

I think it is good practice to put a human readable message in the body in order to call it a chat message otherwise it is a realtime message like a pub-sub notification event.

No sure what offline storage in openfire is currently doing, but monitoring plugin will not archive any message stanza without a body tag last time I checked. I appreciate what the spec says about the type attribute of the message stanza but in practice, what use is a chat message without a body providing the text?

For chat messages I agree. But the TO is talking about messages in general. Maybe he sends normal messages.