use of com.xabber.android.data.xaccount.XMPPAccountSettings in project xabber-android by redsolution.
the class AccountSyncActivity method deleteAccountSettings.
private void deleteAccountSettings(final boolean deleteAccount) {
showProgress(getResources().getString(R.string.progress_title_delete_settings));
if (XabberAccountManager.getInstance().getAccountSyncState(jid) != null && !deleteAccount) {
SettingsManager.setSyncAllAccounts(false);
XabberAccountManager.getInstance().setAccountSyncState(jid, false);
}
Subscription deleteSubscription = AuthManager.deleteClientSettings(jid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<List<XMPPAccountSettings>>() {
@Override
public void call(List<XMPPAccountSettings> settings) {
handleSuccessDelete(settings, deleteAccount);
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
handleErrorDelete(throwable);
}
});
compositeSubscription.add(deleteSubscription);
}
use of com.xabber.android.data.xaccount.XMPPAccountSettings in project xabber-android by redsolution.
the class AccountSyncActivity method updateAccountSettings.
public void updateAccountSettings() {
showProgress(getResources().getString(R.string.progress_title_sync));
Subscription updateSettingsSubscription = AuthManager.patchClientSettings(XabberAccountManager.getInstance().createSettingsList()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<List<XMPPAccountSettings>>() {
@Override
public void call(List<XMPPAccountSettings> s) {
handleSuccessUpdateSettings(s);
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
handleErrorUpdateSettings(throwable);
}
});
compositeSubscription.add(updateSettingsSubscription);
}
use of com.xabber.android.data.xaccount.XMPPAccountSettings in project xabber-android by redsolution.
the class XabberAccountInfoActivity method onDeleteXabberOrgClick.
public void onDeleteXabberOrgClick(String jid) {
showProgress(getString(R.string.progress_title_complete));
Subscription deleteSubscription = AuthManager.deleteClientSettings(jid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<List<XMPPAccountSettings>>() {
@Override
public void call(List<XMPPAccountSettings> settings) {
handleSuccessDelete(settings);
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
handleErrorDelete(throwable);
}
});
compositeSubscription.add(deleteSubscription);
}
use of com.xabber.android.data.xaccount.XMPPAccountSettings in project xabber-android by redsolution.
the class XabberAccountInfoActivity method updateSettings.
private void updateSettings(final boolean needGoToMainActivity) {
Subscription getSettingsSubscription = AuthManager.patchClientSettings(XabberAccountManager.getInstance().createSettingsList()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<List<XMPPAccountSettings>>() {
@Override
public void call(List<XMPPAccountSettings> s) {
Log.d(LOG_TAG, "XMPP accounts loading from net: successfully");
hideProgress();
updateLastSyncTime();
Toast.makeText(XabberAccountInfoActivity.this, R.string.sync_success, Toast.LENGTH_SHORT).show();
if (needGoToMainActivity)
goToMainActivity();
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
Log.d(LOG_TAG, "XMPP accounts loading from net: error: " + throwable.toString());
hideProgress();
Toast.makeText(XabberAccountInfoActivity.this, R.string.sync_fail, Toast.LENGTH_SHORT).show();
}
});
compositeSubscription.add(getSettingsSubscription);
}
Aggregations