* @throws rocks.xmpp.core.stanza.model.StanzaException If the entity returned a stanza error.
* @throws rocks.xmpp.core.session.NoResponseException If the entity did not respond.
* @see <a href="http://xmpp.org/extensions/xep-0016.html#protocol-retrieve">2.3 Retrieving One's Privacy Lists</a>
*/
public Collection<PrivacyList> getPrivacyLists() throws XmppException {
IQ result = xmppSession.query(new IQ(IQ.Type.GET, new Privacy()));
Privacy privacy = result.getExtension(Privacy.class);
List<PrivacyList> privacyLists = new ArrayList<>();
for (PrivacyList privacyList : privacy.getPrivacyLists()) {
if (privacyList.getName() != null && privacyList.getName().equals(privacy.getDefaultName())) {
privacyLists.add(privacyList.asDefault());
}
if (privacyList.getName() != null && privacyList.getName().equals(privacy.getActiveName())) {
privacyLists.add(privacyList.asActive());
}
}
return privacyLists;
}