From 15b8736606ab580ea2ce576ec2bdf1cc031e9fa4 Mon Sep 17 00:00:00 2001 From: Patrick Simpson Date: Wed, 14 Mar 2018 10:50:13 +0200 Subject: [PATCH] [KOE-76] Defaulting to one month sync for new shared store accounts --- src/AcaciaZPushPlugin/EASAccount/EASAccount.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/AcaciaZPushPlugin/EASAccount/EASAccount.cpp b/src/AcaciaZPushPlugin/EASAccount/EASAccount.cpp index 1cd79c8..0e542f2 100644 --- a/src/AcaciaZPushPlugin/EASAccount/EASAccount.cpp +++ b/src/AcaciaZPushPlugin/EASAccount/EASAccount.cpp @@ -7,6 +7,7 @@ static const wstring R_USERNAME = L"EAS User"; static const wstring R_EMAIL = L"Email"; static const wstring R_EMAIL_ORIGINAL = L"KOE Share For"; static const wstring R_PASSWORD = L"EAS Password"; +static const wstring R_ONE_MONTH = L"EAS SyncSlider"; struct Account { @@ -22,6 +23,7 @@ public: wstring password; vector encryptedPassword; wstring dataFolder; + bool syncOneMonth; private: wstring path; int initializedMAPI = 0; @@ -389,6 +391,9 @@ private: if (!emailOriginal.empty()) WriteAccountKey(R_EMAIL_ORIGINAL, emailOriginal); + if (syncOneMonth) + WriteAccountKey(R_ONE_MONTH, (DWORD)1); + WriteAccountKey(L"clsid", L"{ED475415-B0D6-11D2-8C3B-00104B2A6676}"); WriteAccountKey(R_PASSWORD, &encryptedPassword[0], encryptedPassword.size()); @@ -532,9 +537,9 @@ int __cdecl wmain(int argc, wchar_t **argv) // Main try { - if (argc != 7) + if (argc < 7 || argc > 8) { - fwprintf(stderr, L"EASAccount: \n"); + fwprintf(stderr, L"EASAccount: [1 month]\n"); exit(3); } @@ -547,6 +552,9 @@ int __cdecl wmain(int argc, wchar_t **argv) account.email = argv[5]; account.accountName = account.email; account.displayName = argv[6]; + account.syncOneMonth = true; + if (argc > 7) + account.syncOneMonth = !wcscmp(argv[7], L"1"); // Create the account account.Create();