Hi,
I am confused … How would I send a message to a buddy on my roster.
When I send a message to “user@domain/Exodus” everything seems to work fine. Problem is that I don’'t know how to do aquire the fully qualified, i.e. with resource, jid. When adding a user to the roster with:
smackRoster.createEntry(“tu2@localhost/Exodus”, “Carmen”, new String[] {“A new group”});
Smack sends the following packets:
PacketListener WRITE: A New Group
PacketListener WRITE:
So far so good.
After that rosterModified() is called twice.
And I also get:
PacketListener READ: A New Group
PacketListener READ:
PacketListener READ: A New Group
In the latter entry there is just tu2@localhost and not tu2@localhost/Exodus. How should I send a message now? If I just send it to the short JID Exodus doesn’'t pick up the message. Only when I include the resource it picks up the message.
Am I missing the point? How can I talk to somebody on the roster when the roster omits the resource.
I first thought that I need to manage the resources when listening to the presenceChanged() calls, but they are also without the resource.
How do other people solve this?
Mariano
ps. I was talking about
String message = “xyz”;
String jid = “tu2@localhost”;
Message messagePacket= new Message(jid );
messagePacket.setBody(message);
connection.sendPacket(messagePacket);
When I specify the message type as chat, it works, but not for “normal” messages.
Message was edited by: mariano