use of com.xabber.android.data.connection.OnResponseListener in project xabber-android by redsolution.
the class MessageArchiveManager method requestPreferences.
private void requestPreferences(String account) {
Pref pref = new Pref();
pref.setType(Type.get);
try {
ConnectionManager.getInstance().sendRequest(account, pref, new OnResponseListener() {
@Override
public void onReceived(String account, String packetId, IQ iq) {
if (iq instanceof Pref && ((Pref) iq).isValid())
onPreferencesResponce(account, (Pref) iq);
onPreferenceAvailable(account);
}
@Override
public void onError(String account, String packetId, IQ iq) {
onPreferenceAvailable(account);
}
@Override
public void onTimeout(String account, String packetId) {
onError(account, packetId, null);
}
@Override
public void onDisconnect(String account, String packetId) {
}
});
} catch (NetworkException e) {
}
}
Aggregations