Quantcast
Channel: Ignite Realtime : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 10742

block all comunications from user (jid) not working for me

$
0
0

Dear All

I read this alot  http://www.igniterealtime.org/builds/smack/docs/latest/javadoc/org/jivesoftware/ smack/packet/PrivacyItem.html but still can not make it to work please help

#1   if the blocking will be done on ther server side what the PrivaceListener for ?????????????????????????

 

#2 if i'm blocking mss, presnce here {   item.setFilterMessage(true) ; }  what the false in

{  new PrivacyItem(PrivacyItem.Type.jid.toString()   , false  , 1); }     do ??

 

 

 

String listName = "newList12sc34";

String user = "b@ubuntu"

 

                    // Create the list of PrivacyItem that will allow or deny some privacy aspect

                    ArrayList privacyItems = new ArrayList<PrivacyItem>();

 

 

                    PrivacyItem item = new PrivacyItem(PrivacyItem.Type.jid.toString()   , false  , 1);

                    item.setValue(user);

 

// I need to prevent rececving msgs from this user

                    item.setFilterMessage(true) ;

                    item.setFilterPresence_out( true ) ;

 

                    privacyItems.add(item);

 

 

                    // Get the privacy manager for the current connection.

                    PrivacyListManager privacyManager = PrivacyListManager.getInstanceFor(MyApplication.connection );

                    // Create the new list.

                    try {

                              privacyManager.createPrivacyList(listName,  privacyItems );

                    } catch (XMPPException e) {

                              // TODO Auto-generated catch block

                              e.printStackTrace();

                    }

 

 

<iq id="8hNHn-16" from="f@ubuntu/Smack" type="set"><query xmlns="jabber:iq:privacy"><list name="newList12sc34"><item action="deny" order="1" type="jid" value="b@ubuntu"><message/></item></list></query></iq>


Viewing all articles
Browse latest Browse all 10742

Trending Articles