Hello,
I´m trying to make a client at this moment:
I have no problems to log into a gateway and add all the contacts from the gateway acount to the rooster, this is done automatically.
But if other user add me, and I want to add him, is annoying me. The other user can see me but I don´t and I have read several post about this.
My RosterListener receive a message from the other user but it don´t suscribes automatically to the other.
I have found this that is suposed to work, but for me not:
RosterEntry entry = connection.getRoster().getEntry(address);
//When the entry is only from the other user, then send a subscription request
if (entry != null && entry.getType() == RosterPacket.ItemType.from) {
try {
System.out.println("Creating entry to: " + entry.getUser());
connection.getRoster().createEntry(entry.getUser(), entry.getUser(), new String[0]);
} catch (XMPPException e) {
e.printStackTrace();
}
}
Thanks in advance