"receiver cannot be null for xmpp instant messaging");
else if (receiver instanceof XMPPID) {
final XMPPID rcvr = (XMPPID) receiver;
aMsg.setType(Message.Type.chat);
final String receiverName = rcvr.getFQName();
final Chat localChat = connection.getChatManager()
.createChat(receiverName, new MessageListener() {
public void processMessage(Chat chat,
Message message) {
}
});
localChat.sendMessage(aMsg);
} else if (receiver instanceof XMPPRoomID) {
final XMPPRoomID roomID = (XMPPRoomID) receiver;
aMsg.setType(Message.Type.groupchat);
final String to = roomID.getMucString();
aMsg.setTo(to);