use of net.iGap.model.GoToMainFromRegister in project iGap-Android by KianIranian-STDG.
the class RegisterRepository method getUserInfo.
private void getUserInfo() {
Log.wtf(this.getClass().getName(), "getUserInfo");
G.onUserInfoResponse = new OnUserInfoResponse() {
@Override
public void onUserInfo(final ProtoGlobal.RegisteredUser user, String identity) {
if (user.getId() == userId) {
AccountManager.getInstance().updateCurrentNickName(user.getDisplayName());
AccountManager.getInstance().updatePhoneNumber(String.valueOf(user.getPhone()));
DbManager.getInstance().doRealmTask(realm -> {
realm.executeTransactionAsync(realm1 -> RealmUserInfo.putOrUpdate(realm1, user), () -> G.onUserInfoResponse = null);
});
if (newUser) {
goToSyncContactPageForNewUser.postValue(userId);
} else {
goToMainPage.postValue(new GoToMainFromRegister(forgetTwoStepVerification, userId));
}
}
}
@Override
public void onUserInfoTimeOut() {
requestUserInfo();
}
@Override
public void onUserInfoError(int majorCode, int minorCode) {
}
};
}
Aggregations