cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
396
Views
0
Helpful
1
Replies

Fetching only user's contact using roster not the one in unknown group

satalrej
Level 1
Level 1

Hi,

I want to fetch only those contacts which are added to specific groups, not to unknown. As of now, even if I select "contacts only" check box, it also displays contacts which are in unknown group.

Thanks,

Sapna

1 Reply 1

tinghche
Level 5
Level 5

Let's say you are fetching the roster, then for each entity, you can check for the specific group, or "null" for contact who are not in any of the group.

var myentity = jabberwerx.RosterContact;

for(var i=0; i<jids.length; i++) {

  myentity = jids[i];

     if(myentity.getGroups() != "specific group name") {

       rosterpresence = myentity.getPrimaryPresence();

     }

}

or, myentity.getGroups() != "" for the group name that is empty.

Thanks,

Howard