Skip to content

Commit

Permalink
Merge pull request #3009 from nextcloud/bugfix/check-not-for-productname
Browse files Browse the repository at this point in the history
Don't check against product name if checking server version
  • Loading branch information
Felix Weilbach authored Mar 16, 2021
2 parents 162dff9 + c0f09ae commit 96ded93
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions VERSION.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set( MIRALL_VERSION_PATCH 81 )
set( MIRALL_VERSION_YEAR 2020 )
set( MIRALL_SOVERSION 0 )

# Minimum supported server version according to https://docs.nextcloud.com/server/latest/admin_manual/release_schedule.html
set(NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_MAJOR 19)
set(NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_MINOR 0)
set(NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_PATCH 0)

if ( NOT DEFINED MIRALL_VERSION_SUFFIX )
set( MIRALL_VERSION_SUFFIX "git") #e.g. beta1, beta2, rc1
endif( NOT DEFINED MIRALL_VERSION_SUFFIX )
Expand Down
5 changes: 3 additions & 2 deletions src/libsync/account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "capabilities.h"
#include "theme.h"
#include "pushnotifications.h"
#include "version.h"

#include "common/asserts.h"
#include "clientsideencryption.h"
Expand Down Expand Up @@ -531,8 +532,8 @@ bool Account::serverVersionUnsupported() const
// not detected yet, assume it is fine.
return false;
}
// Older version which is not "end of life" according to https://docs.nextcloud.com/server/latest/admin_manual/release_schedule.html
return serverVersionInt() < makeServerVersion(18, 0, 0) || !serverVersion().endsWith("Nextcloud");
return serverVersionInt() < makeServerVersion(NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_MAJOR,
NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_MINOR, NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_PATCH);
}

void Account::setServerVersion(const QString &version)
Expand Down
2 changes: 1 addition & 1 deletion src/libsync/networkjobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ void CheckServerJob::onTimedOut()

QString CheckServerJob::version(const QJsonObject &info)
{
return info.value(QLatin1String("version")).toString() + "-" + info.value(QLatin1String("productname")).toString();
return info.value(QLatin1String("version")).toString();
}

QString CheckServerJob::versionString(const QJsonObject &info)
Expand Down
4 changes: 4 additions & 0 deletions version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@

#define MIRALL_VERSION_STRING "@MIRALL_VERSION_STRING@"

constexpr int NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_MAJOR = @NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_MAJOR@;
constexpr int NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_MINOR = @NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_MINOR@;
constexpr int NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_PATCH = @NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_PATCH@;

#endif // VERSION_H

0 comments on commit 96ded93

Please sign in to comment.