From db4e0d37672f8fde92535c40c8f7c612ab98bc81 Mon Sep 17 00:00:00 2001
From: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
Date: Wed, 22 Nov 2023 11:51:36 -0500
Subject: [PATCH] Revert "app Store: disable donations"

This reverts commit a433974340d4700a251b4e1278ff767341185d26.

Change-Id: I1a3b663a3f6813ed0481bf4a118330cf5d974424
---
 CMakeLists.txt                                |  1 -
 src/app/appsettingsmanager.h                  | 37 -------------------
 src/app/mainapplication.cpp                   |  9 +----
 .../components/SystemSettingsPage.qml         |  2 +-
 src/app/tipsmodel.cpp                         |  3 --
 5 files changed, 2 insertions(+), 50 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 22c7d17b0..57d50759b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -798,7 +798,6 @@ else()
           MACOSX_BUNDLE_COPYRIGHT "${PROJ_COPYRIGHT}")
       if(APPSTORE)
           message(STATUS "app store version")
-          add_definitions(-DAPPSTORE)
           set_target_properties(${PROJECT_NAME} PROPERTIES
                XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/resources/entitlements/appstore/Jami.entitlements")
       else()
diff --git a/src/app/appsettingsmanager.h b/src/app/appsettingsmanager.h
index 9ed4984d4..9e81c98ae 100644
--- a/src/app/appsettingsmanager.h
+++ b/src/app/appsettingsmanager.h
@@ -33,41 +33,6 @@
 extern const QString defaultDownloadPath;
 
 // clang-format off
-#ifdef APPSTORE
-#define KEYS \
-    X(MinimizeOnClose, false) \
-    X(DownloadPath, defaultDownloadPath) \
-    X(ScreenshotPath, {}) \
-    X(EnableNotifications, true) \
-    X(EnableTypingIndicator, true) \
-    X(EnableReadReceipt, true) \
-    X(AcceptTransferBelow, 20) \
-    X(AutoAcceptFiles, true) \
-    X(DisplayHyperlinkPreviews, true) \
-    X(AppTheme, "System") \
-    X(BaseZoom, 1.0) \
-    X(ParticipantsSide, false) \
-    X(HideSelf, true) \
-    X(HideSpectators, false) \
-    X(AutoUpdate, true) \
-    X(PluginAutoUpdate, false) \
-    X(StartMinimized, false) \
-    X(ShowChatviewHorizontally, true) \
-    X(NeverShowMeAgain, false) \
-    X(WindowGeometry, QRectF(qQNaN(), qQNaN(), 0., 0.)) \
-    X(WindowState, QWindow::AutomaticVisibility) \
-    X(EnableExperimentalSwarm, false) \
-    X(LANG, "SYSTEM") \
-    X(PluginStoreEndpoint, "https://plugins.jami.net") \
-    X(PositionShareDuration, 15) \
-    X(PositionShareLimit, true) \
-    X(FlipSelf, true) \
-    X(ShowMardownOption, false) \
-    X(ChatViewEnterIsNewLine, false) \
-    X(ShowSendOption, false)  \
-    X(EnablePtt, false) \
-    X(pttKey, 36)
-#else
 #define KEYS \
     X(MinimizeOnClose, false) \
     X(DownloadPath, defaultDownloadPath) \
@@ -104,8 +69,6 @@ extern const QString defaultDownloadPath;
     X(Donation2023EndDate, "2024-01-31 00:00") \
     X(EnablePtt, false) \
     X(pttKey, 36)
-#endif
-
 /*
  * A class to expose settings keys in both c++ and QML.
  * Note: this is using a non-constructable class instead of a
diff --git a/src/app/mainapplication.cpp b/src/app/mainapplication.cpp
index 94fcb6921..d94b0f27c 100644
--- a/src/app/mainapplication.cpp
+++ b/src/app/mainapplication.cpp
@@ -105,8 +105,7 @@ ScreenInfo::onPhysicalDotsPerInchChanged()
 }
 
 MainApplication::MainApplication(int& argc, char** argv)
-    : QApplication(argc, argv)
-    , isCleanupped(false)
+    : QApplication(argc, argv), isCleanupped(false)
 {
     const char* qtVersion = qVersion();
     qInfo() << "Using Qt runtime version:" << qtVersion;
@@ -197,12 +196,6 @@ MainApplication::init()
     engine_.get()->rootContext()->setContextProperty("WITH_WEBENGINE", QVariant(false));
 #endif
 
-#ifdef APPSTORE
-    engine_.get()->rootContext()->setContextProperty("APPSTORE", QVariant(true));
-#else
-    engine_.get()->rootContext()->setContextProperty("APPSTORE", QVariant(false));
-#endif
-
     initQmlLayer();
 
     settingsManager_->setValue(Settings::Key::StartMinimized,
diff --git a/src/app/settingsview/components/SystemSettingsPage.qml b/src/app/settingsview/components/SystemSettingsPage.qml
index 5d0c98733..abc472136 100644
--- a/src/app/settingsview/components/SystemSettingsPage.qml
+++ b/src/app/settingsview/components/SystemSettingsPage.qml
@@ -84,7 +84,7 @@ SettingsPageBase {
             ToggleSwitch {
                 id: enableDonation
                 width: parent.width
-                visible: (new Date() >= new Date(Date.parse("2023-11-01")) && !APPSTORE)
+                visible: new Date() >= new Date(Date.parse("2023-11-01"))
 
                 checked: UtilsAdapter.getAppValue(Settings.Key.IsDonationVisible)
                 labelText: JamiStrings.enableDonation
diff --git a/src/app/tipsmodel.cpp b/src/app/tipsmodel.cpp
index 516a77bca..914713a61 100644
--- a/src/app/tipsmodel.cpp
+++ b/src/app/tipsmodel.cpp
@@ -75,13 +75,10 @@ TipsModel::reset()
     beginResetModel();
     tips_.clear();
 
-#ifndef APPSTORE
     QDate date = QDate::currentDate();
     if (date >= QDate::fromString("2023-11-27", "yyyy-MM-dd")) {
         tips_.append({{"id", "14"}, {"title", tr("Donate")}, {"desc", ""}, {"type", "donation"}});
     }
-#endif
-
     tips_.append({{"id", "0"}, {"title", tr("Customize")}, {"desc", ""}, {"type", "customize"}});
     tips_.append({{"id", "13"}, {"title", tr("Backup account")}, {"desc", ""}, {"type", "backup"}});
     tips_.append({{"id", "1"},
-- 
GitLab