How to know if recipient is offline?

I am finding that if I send a message to an offline user I don’t get an error (at least not synchronously). When I disable offline messages on openfire, I did notice that a message is returned that contains an error in the XML, however message.getError() returns null. So have three questions:

  1. Is there a way to get a synchronous error if the recipient is offline when I call chat.sendMessage(…

  2. If #1 is not possible, is there an alternative method to determine if a recipient is online

  3. If #1 is not possible, how do I get the error without having to parse the XML from the toXML() method? Also, is there a way to correlate the inbound error message to the outbound message. I see there is a message id, but how do I match this up with the outbound message? The error message I received is:

hello xbeezu4eC0

error is item-not-found(404)