Hi am using smack 4.3.4.
When am blocking a user it work until I re-login.
after relogin messages can recieved again even i see user is blocked.
My code is:
public boolean blockContact(Jid jid) {
String listName = "block-list";
// Create the list of PrivacyItem that will allow or
// deny some privacy aspect
List<PrivacyItem> privacyItems = new Vector<>();
PrivacyItem item = new PrivacyItem(PrivacyItem.Type.jid, jid, false, 1);
item.setFilterIQ(false);
item.setFilterMessage(false);
item.setFilterPresenceIn(false);
item.setFilterPresenceOut(false);
privacyItems.add(item);
// Get the privacy manager for the current connection.
// Create the new list.
PrivacyListManager privacyManager = PrivacyListManager.getInstanceFor(Connection.getInstance().getXmpptcpConnection());
try {
privacyManager.updatePrivacyList(listName, privacyItems);
privacyManager.setActiveListName(listName);
return true;
} catch (Exception e) {
Log.e("PRIVACY_ERROR: ", " " + e.toString());
e.printStackTrace();
}
return false;
}
Please let me know why a user can received message if he blocked and In still in blocked list after relogin.