Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit a98a1cc6 authored by tobiasKaminsky's avatar tobiasKaminsky
Browse files

renamed status code

parent 95276241
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ public class RemoteOperationResult implements Serializable {
        MAINTENANCE_MODE,
        LOCK_FAILED,
        DELAYED_IN_POWER_SAVE_MODE,
        ACCOUNT_USES_OLD_LOGIN
        ACCOUNT_USES_STANDARD_PASSWORD
    }

    private boolean mSuccess = false;
+3 −3
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ public class RegisterAccountDeviceForNotificationsOperation extends RemoteOperat
                result.setPushResponseData(pushResponse);
            } else {
                if (isInvalidSessionToken(response)) {
                    result = new RemoteOperationResult(RemoteOperationResult.ResultCode.ACCOUNT_USES_OLD_LOGIN);
                    result = new RemoteOperationResult(RemoteOperationResult.ResultCode.ACCOUNT_USES_STANDARD_PASSWORD);
                } else {
                    result = new RemoteOperationResult(false, status, post.getResponseHeaders());
                }
@@ -135,8 +135,8 @@ public class RegisterAccountDeviceForNotificationsOperation extends RemoteOperat

    private boolean isInvalidSessionToken(String response) {
        JsonParser jsonParser = new JsonParser();
        JsonObject jo = (JsonObject)jsonParser.parse(response);
        String message = String.valueOf(jo.getAsJsonObject(NODE_OCS).getAsJsonObject(NODE_DATA).get(MESSAGE));
        JsonObject jsonObject = (JsonObject)jsonParser.parse(response);
        String message = jsonObject.getAsJsonObject(NODE_OCS).getAsJsonObject(NODE_DATA).get(MESSAGE).getAsString();

        return INVALID_SESSION_TOKEN.equals(message);
    }