If first version is null, try to get it from capabilities

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2018-09-11 10:27:53 +02:00
parent 6ade530a26
commit 3ac8a8875b
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -86,6 +86,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCo
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.lib.resources.status.OCCapability;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
import com.owncloud.android.media.MediaService;
import com.owncloud.android.media.MediaServiceBinder;
@ -191,6 +192,8 @@ public class FileDisplayActivity extends HookActivity
public static final String TEXT_PREVIEW = "TEXT_PREVIEW";
private static final String VERSION_DOT = ".";
private OCFile mWaitingToPreview;
private boolean mSyncInProgress;
@ -365,6 +368,12 @@ public class FileDisplayActivity extends HookActivity
if (MainApp.getVersionCode() > lastSeenVersion) {
OwnCloudVersion serverVersion = AccountUtils.getServerVersionForAccount(account, this);
if (serverVersion == null) {
OCCapability capability = getCapabilities();
serverVersion = new OwnCloudVersion(capability.getVersionMayor() + VERSION_DOT +
capability.getVersionMinor() + VERSION_DOT + capability.getVersionMinor());
}
if (MainApp.OUTDATED_SERVER_VERSION.compareTo(serverVersion) >= 0) {
DisplayUtils.showServerOutdatedSnackbar(this);