powered by Jive Software

Asmack library. Problem in Roster on request users

Hi guys! I use 4.0.3 asmack library version. I have a problem with rosterr I just created connection, got roster from it and added listener to presence like this :

connection = new XMPPTCPConnection(configuration);

connection.addConnectionListener(new QBConnectionListener());

            connection.connect();

connection.login(name, pass, resourece);

Roster roster = connection.getRoster();

roster.setSubscriptionMode(Roster.SubscriptionMode.manual);

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 .

Could you just set default subscription mode in roster to “manual”,
Why don’t you do it? Roster.setDefaultSubscriptionMode()

Oh, thank you very much. I forgot this case. I’ll try it