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

Commit d118c8ac authored by Mario Đanić's avatar Mario Đanić Committed by GitHub
Browse files

Merge branch 'master' into socket-check

parents a12d77c7 9bf41f04
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ buildscript {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
    }
}
+22 −32
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import com.owncloud.android.lib.common.UserInfo;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;

import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.NameValuePair;
@@ -107,20 +106,13 @@ public class GetRemoteUserInfoOperation extends RemoteOperation {
        RemoteOperationResult result = null;
        int status = -1;
        GetMethod get = null;
        String url;
        String url = client.getBaseUri() + OCS_ROUTE_SELF;

        OwnCloudBasicCredentials credentials = (OwnCloudBasicCredentials) client.getCredentials();

        OwnCloudVersion version = client.getOwnCloudVersion();
        boolean versionWithSelfAPI = version != null && version.isSelfSupported();
        OwnCloudBasicCredentials credentials = (OwnCloudBasicCredentials) client.getCredentials();
        
        //Get the user
        try {
            if (!versionWithSelfAPI) {
                url = client.getBaseUri() + OCS_ROUTE_SEARCH + credentials.getUsername();
            } else {
                url = client.getBaseUri() + OCS_ROUTE_SELF;
            }

            get = new GetMethod(url);
            get.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);
@@ -173,7 +165,6 @@ public class GetRemoteUserInfoOperation extends RemoteOperation {

                userInfo.setQuota(new Quota(quotaFree, quotaUsed, quotaTotal, quotaRelative, quotaValue));

                if (versionWithSelfAPI) {
                if (respData.has(NODE_PHONE) && !respData.isNull(NODE_PHONE) &&
                        !TextUtils.isEmpty(respData.getString(NODE_PHONE))) {
                    userInfo.setPhone(respData.getString(NODE_PHONE));
@@ -193,7 +184,6 @@ public class GetRemoteUserInfoOperation extends RemoteOperation {
                        !TextUtils.isEmpty(respData.getString(NODE_TWITTER))) {
                    userInfo.setTwitter(respData.getString(NODE_TWITTER));
                }
                }

                if (respData.has(NODE_ENABLED)) {
                    userInfo.setEnabled(respData.getBoolean(NODE_ENABLED));