mirror of
https://github.com/nextcloud/android.git
synced 2024-11-29 02:38:58 +03:00
If first version is null, try to get it from capabilities
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
6ade530a26
commit
3ac8a8875b
1 changed files with 9 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue