Hi , I am working on a chat application on android platform using asmack library and openfire 3.7.1 as a server. Now i want to block a particular friend from my chat list. my code for doing this :
public void blockUser(String userName)
{
String listName = “newList”;
// Create the list of PrivacyItem that will allow or
// deny some privacy aspect
//ArrayList privacyItems = new ArrayList();
List privacyItems = new Vector();
PrivacyItem item=new PrivacyItem(PrivacyItem.Type.jid.toString(), false, 1);
item.setValue(userName);
privacyItems.add(item);
// Get the privacy manager for the current connection.
// Create the new list.
privacyManager = PrivacyListManager.getInstanceFor(mXMPPConnection);
try
{
privacyManager.createPrivacyList(listName,privacyItems);
}
catch(Exception e)
{
Log.e("PRIVACY_ERROR: “,” "+e.toString());
e.printStackTrace();
}
}
code works fine . there is no Exception but i am not able to block a user. Can anyone help me. Thanks in advance.
Smack Logs which i got :
09-04 19:00:37.848: D/SMACK(3895): 07:00:37 PM SENT (1149259528):
09-04 19:00:38.248: D/SMACK(3895): 07:00:38 PM RCV (1149259528):
09-04 19:00:38.368: D/SMACK(3895): 07:00:38 PM SENT (1149259528):
09-04 19:00:38.658: D/SMACK(3895): 07:00:38 PM RCV (1149259528):