2
votes

I'm doing an iPhone chat app - using an openfire chat server.

How would you communicate with the openfire server to achieve BOTH:

  1. find out if the receiving user is currently online or not (connected to openfire xmpp server or not) - which determines if we do a push notification or further action to an offline user

AND

  1. send the message contents to the receiving user

... WITHOUT doing two calls?

How can you do it in ONE call/request?

Any insights are appreciated! Any way to hack the openfire server?

1

1 Answers

2
votes

You will have to do two requests I am afraid. You cannot combine sending a message and presence prob calls in one call. In xmpp there events also called Stenza have three main types IQ, Message, and Presence. Therefore the act of combining Presence and Message does not really comply with the protocol.

Regarding offline storage you should also configure your openfire server to allow/disallow offline messages. You can do this by going to your admin panel > server > server settings > Offline Messages.