Skip to content

Commit

Permalink
If the client is branded the default update channel is stable.
Browse files Browse the repository at this point in the history
Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan committed Jul 3, 2024
1 parent 94736b2 commit bf23b94
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/libsync/configfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,13 @@ int ConfigFile::updateSegment() const

QStringList ConfigFile::validUpdateChannels() const
{
if (serverHasValidSubscription() && !Theme::instance()->isBranded()) {
const auto isBranded = Theme::instance()->isBranded();

if (isBranded) {
return { defaultUpdateChannelName };
}

if (serverHasValidSubscription()) {
return enterpriseUpdateChannelsList;
}

Expand All @@ -703,7 +709,8 @@ QStringList ConfigFile::validUpdateChannels() const

QString ConfigFile::defaultUpdateChannel() const
{
if (serverHasValidSubscription() && !Theme::instance()->isBranded()) {
const auto isBranded = Theme::instance()->isBranded();
if (serverHasValidSubscription() && !isBranded) {
if (const auto serverChannel = desktopEnterpriseChannel();
validUpdateChannels().contains(serverChannel)) {
qCWarning(lcConfigFile()) << "Enforcing update channel" << serverChannel << "because that is the desktop enterprise channel returned by the server.";
Expand All @@ -712,11 +719,12 @@ QString ConfigFile::defaultUpdateChannel() const
}

if (const auto currentVersionSuffix = Theme::instance()->versionSuffix();
validUpdateChannels().contains(currentVersionSuffix)) {
validUpdateChannels().contains(currentVersionSuffix) && !isBranded) {
qCWarning(lcConfigFile()) << "Enforcing update channel" << currentVersionSuffix << "because of the version suffix of the current client.";
return currentVersionSuffix;
}

qCWarning(lcConfigFile()) << "Enforcing default update channel" << defaultUpdateChannelName;
return defaultUpdateChannelName;
}

Expand Down

0 comments on commit bf23b94

Please sign in to comment.