Double Check Chat messages Openfire Xmpp (Muc) online offline

Good afternoon,

How I can do double check and whatsapp?

**http://fielinks.com/sites/default/files/styles/large/public/images/double-check- whatsapp.jpg?itok=qBI0LGQL **

  1. ** - The first check shows that the data has been sent to the server **
  2. ** - The second check shows that the data has read the other uduario. **
  • How in openfire I can do this?

Example : I have one user that this user sends more message to another user offilne.

A greeting.

I think, for the first check Openfire would need to have XEP-0198 Stream Management implemented.

So, that the client can have an acknowledgement, that the server received a message.

But it isn’t implemented in Openfire.

The second check could be done with a client side protocol, but I think there isn’t any defined in XMPP.

Here was a discussion about it, if you are interested:

http://jabber.996255.n3.nabble.com/Message-Read-Receipts-td31029.html

Any can show a example please ?

I don’t know how do it.

@First Check: No idea. It’s neither implemented in Openfire nor in Smack.

@Second Check: Please ask in the Smack forum how to write a custom extension. Maybe you can also use Message Delivery Receipts. It’s not quite the same as Message Read Receipts, but maybe it’s sufficient for you.

You can also read http://xmpp.org/extensions/xep-0333.html

I think it’s what you want, but you have to implement it on your own.

This is not Openfire responsibility, the client should implement it. You can use MessageEventManager in (a)smack even you can check if the message seen by the user ® or if the user is composing a reply to it (Typing…).

http://www.igniterealtime.org/builds/smack/docs/3.4.0/javadoc/org/jivesoftware/s mackx/MessageEventManager.html

Edit:

**>>The first check shows that the data has been sent to the serve
**

e.g:

try {

chat.sendMessage(msg);

//MESSAGE_SEND_STATE_SENT

} catch (Exception e) {

//MESSAGE_SEND_STATE_SEND_ERROR

}

Should only be noted, that MessageEventManager builds upon obsoleted specification (XEP-0022: Message Events)

Implementation of the protocol described herein is not recommended.

On the other side the replacements (XEP-0085 and XEP-0184) don’t specify something for the “displayed” event.

I guess your suggestion Message Delivery Receipts is the right answer.

But some time to get what you need you can live with a nonstandard XEP, and if another library is not supporting it you can add your own extention to the message.

I tried

http://stackoverflow.com/questions/21458018/delivery-receipt-requests-not-workin g-for-xmpp-android-asmack

and

http://stackoverflow.com/questions/9838020/how-to-get-custom-attribute-value-fro m-an-xmpp-xml-message

not work in java normal eclipse / and / android, listener never called.

Not exist any example full ?

Works and not works, Why? “Message Delivery Receipts

Example

Work 1/3

user1 (connect)

user2 send message user1

user2 (connect) receive from user1 (check receiv correct)

Work 2/3

user1 (disconnect)

user2 send message user1

user1 (connect)

user2 (connect) receive from user1 (check receiv correct)

Not work 3/3 ( This case is the best important ) user1(no internet) + user2(no internet) = never work check

user1 (disconnect)

user2 send message user1

user2 (disconnect)

user1 (connect)

user2 (connect) not receive from user1 (no check receiv correct)

When in facebook, you read a message, and then you disconnect, the other user is re To connect, you see that you have read the comment of mine

If you use Openfire <= 3.9.2, there was a bug: OF-722

Interesant, is my problem

How I can solve this problem ? I need latest version openfire ? or old version ?

Either latest OF version or simply include a non-empty body in the “receipt” message, e.g. a space " ".

found any solution for this?