From dc7c366afa8fe1e985178013deeacd219c85c67f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Tue, 28 Nov 2023 10:58:42 -0500
Subject: [PATCH] donation: update campaign dates

Change-Id: Idc8b568234270f897936e60453e22a66d6d8624d
---
 src/app/appsettingsmanager.h      | 4 ++--
 src/app/constant/JamiQmlUtils.qml | 6 +++---
 src/app/constant/JamiStrings.qml  | 2 +-
 src/app/constant/JamiTheme.qml    | 2 +-
 src/app/tipsmodel.cpp             | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/app/appsettingsmanager.h b/src/app/appsettingsmanager.h
index 7a9230908..9ed4984d4 100644
--- a/src/app/appsettingsmanager.h
+++ b/src/app/appsettingsmanager.h
@@ -99,9 +99,9 @@ extern const QString defaultDownloadPath;
     X(ShowMardownOption, false) \
     X(ChatViewEnterIsNewLine, false) \
     X(ShowSendOption, false) \
-    X(DonationVisibleDate, "2023-11-01 05:00") \
+    X(Donation2023VisibleDate, "2023-11-27 05:00") \
     X(IsDonationVisible, true) \
-    X(DonationEndDate, "2024-01-01 00:00") \
+    X(Donation2023EndDate, "2024-01-31 00:00") \
     X(EnablePtt, false) \
     X(pttKey, 36)
 #endif
diff --git a/src/app/constant/JamiQmlUtils.qml b/src/app/constant/JamiQmlUtils.qml
index 5e104aa0e..968f98ca9 100644
--- a/src/app/constant/JamiQmlUtils.qml
+++ b/src/app/constant/JamiQmlUtils.qml
@@ -75,8 +75,8 @@ Item {
         // The banner is visible if the current date is after the date set in the settings and before the end date
         // And if the donation toggle is checked
         var isDonationVisible = UtilsAdapter.getAppValue(Settings.Key.IsDonationVisible);
-        var endDonationDate = new Date(Date.parse(UtilsAdapter.getAppValue(Settings.Key.DonationEndDate)));
-        var donationVisibleDate = new Date(Date.parse(UtilsAdapter.getAppValue(Settings.Key.DonationVisibleDate)));
-        return new Date() < endDonationDate && new Date() > donationVisibleDate && isDonationVisible && false;
+        var endDonationDate = new Date(Date.parse(UtilsAdapter.getAppValue(Settings.Key.Donation2023EndDate)));
+        var donationVisibleDate = new Date(Date.parse(UtilsAdapter.getAppValue(Settings.Key.Donation2023VisibleDate)));
+        return new Date() < endDonationDate && new Date() > donationVisibleDate && isDonationVisible;
     }
 }
diff --git a/src/app/constant/JamiStrings.qml b/src/app/constant/JamiStrings.qml
index 9cff727d1..c8b96422b 100644
--- a/src/app/constant/JamiStrings.qml
+++ b/src/app/constant/JamiStrings.qml
@@ -853,7 +853,7 @@ Item {
     property string zoomLevel: qsTr("Text zoom level")
 
     //Donation campaign
-    property string donationTipBoxText: qsTr("Free and private sharing. <a href=\"https://jami.net/donate/\">Donate</a> to expand it.")
+    property string donationTipBoxText: qsTr("Free and private sharing. <a href=\"https://jami.net/whydonate/\">Donate</a> to expand it.")
     property string donation: qsTr("Donate")
     property string donationText: qsTr("If you enjoy using Jami and believe in our mission, would you make a donation?")
     property string notNow: qsTr("Not now")
diff --git a/src/app/constant/JamiTheme.qml b/src/app/constant/JamiTheme.qml
index 4c3b28990..716cbad30 100644
--- a/src/app/constant/JamiTheme.qml
+++ b/src/app/constant/JamiTheme.qml
@@ -681,7 +681,7 @@ Item {
     // Donation campaign
     property color donationButtonTextColor: "#005699"
     property color donationBackgroundColor: "#D5E4EF"
-    property string donationUrl: "https://jami.net/donate/"
+    property string donationUrl: "https://jami.net/whydonate/"
 
     //Connection monitoring
     property color connectionMonitoringTableColor1: darkTheme ? "#4D4D4D" : "#f0efef"
diff --git a/src/app/tipsmodel.cpp b/src/app/tipsmodel.cpp
index a3a85fad5..516a77bca 100644
--- a/src/app/tipsmodel.cpp
+++ b/src/app/tipsmodel.cpp
@@ -77,7 +77,7 @@ TipsModel::reset()
 
 #ifndef APPSTORE
     QDate date = QDate::currentDate();
-    if (date >= QDate::fromString("2023-11-01", "yyyy-MM-dd") && false) {
+    if (date >= QDate::fromString("2023-11-27", "yyyy-MM-dd")) {
         tips_.append({{"id", "14"}, {"title", tr("Donate")}, {"desc", ""}, {"type", "donation"}});
     }
 #endif
-- 
GitLab