The only way that I can figure out to this is the following:
Chat chat = connection.createChat (recipient);
chat.sendMessage (“message body”);
Message m = chat.nextMessage (500);
if (null != m && chatm.getType ().equals (Message.Type.ERROR))
throw new Exception (“send Message failed”);
I think that there has to be some better way to determine if a Message was
sent successfully, because this only works if a jabber server specified in
the recipient JID is correct but the user is not registered.
The two specific cases that I am trying to detect are:
there is no jabber server running on ‘‘b.com’’.
Can this be done by creating the a listener and registering it properly? I am
very new to Smack and I would appreciate any help.