Search in sources :

Example 11 with LogIfError

use of chat.rocket.android.helper.LogIfError in project Rocket.Chat.Android by RocketChat.

the class OAuthPresenter method login.

@Override
public void login(JSONObject credentialJsonObject) {
    if (credentialJsonObject == null || !credentialJsonObject.optBoolean("setCredentialToken")) {
        view.showLoginError();
        return;
    }
    final String credentialToken = credentialJsonObject.optString("credentialToken");
    final String credentialSecret = credentialJsonObject.optString("credentialSecret");
    if (TextUtils.isEmpty(credentialToken) || TextUtils.isEmpty(credentialSecret)) {
        view.showLoginError();
        return;
    }
    view.showLoginDone();
    methodCallHelper.loginWithOAuth(credentialToken, credentialSecret).continueWith(new LogIfError());
}
Also used : LogIfError(chat.rocket.android.helper.LogIfError)

Aggregations

LogIfError (chat.rocket.android.helper.LogIfError)11 Context (android.content.Context)6 DDPClientRef (chat.rocket.android.service.DDPClientRef)6 RealmHelper (chat.rocket.persistence.realm.RealmHelper)6 Realm (io.realm.Realm)5 RealmResults (io.realm.RealmResults)4 List (java.util.List)4 JSONObject (org.json.JSONObject)4 RCLog (chat.rocket.android.log.RCLog)3 DebugLog (hugo.weaving.DebugLog)3 JSONArray (org.json.JSONArray)3 RocketChatCache (chat.rocket.android.RocketChatCache)2 Registrable (chat.rocket.android.service.Registrable)2 DDPSubscription (chat.rocket.android_ddp.DDPSubscription)2 SyncState (chat.rocket.core.SyncState)2 MethodCall (chat.rocket.persistence.realm.models.internal.MethodCall)2 RealmSession (chat.rocket.persistence.realm.models.internal.RealmSession)2 Disposable (io.reactivex.disposables.Disposable)2 Uri (android.net.Uri)1 TextUtils (android.text.TextUtils)1