powered by Jive Software

Roster.SubscriptionMode.accept_all seems not to work with offline users

I am implementing a client that accepts all subscription requests (I am using Rooster.setSubscriptionMode(Roster.SubscriptionMode.accept_all). Also, on the first login, every user will send a subscription request to a list of users. The accept_all mode seem to work fine only if the users we are trying to subscribe to are online at the time we are sending the subscrption request. This means that as a user I will never get presence updates from users that were offline at the time I logged in first.

Am I doing something wrong or could this be a problem caused by using asmack?

Hi guys! I use 4.0.3 asmack library version. I have a problem with rosterr too but maybe isn’t the same. I just created connection, got roster from it and added listener to presence like this :

connection = new XMPPTCPConnection(configuration);

connection.addConnectionListener(new QBConnectionListener());


connection.login(name, pass, resourece);

Roster roster = connection.getRoster();


roster.addRosterListener(new RosterListenerImpl());

PacketFilter subscribeFilter = new SubscribeFilter();

PacketListener subscribePacketListener = new SubscribePacketListener();

connection.addPacketListener(subscribePacketListener, subscribeFilter);

The problem is that I set manual subscription mode but in log i see thar roster automatically sends “subscribed presence” on “subscribe” request without doing it by my code. By the way when I send request to user he is offline. It happens not all time but very often and I do not receive “subscribe” presence in packet listener on connection. Please help me. How can I fix this ???
Could you just set default subscription mode in roster to “manual”, because I see in source code it sets to “accept all” requests and maybe it is synchronizing problem in PresencePacketListener in Roster .