mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
Make email sync not remove email account if premium
This commit is contained in:
parent
98c99b3336
commit
2e945e7d9d
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using CommandLine;
|
using CommandLine;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Teknik.Areas.Billing;
|
using Teknik.Areas.Billing;
|
||||||
@ -72,7 +73,7 @@ namespace Teknik.BillingService
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SyncSubscriptions(Config config, TeknikEntities db)
|
public static async Task SyncSubscriptions(Config config, TeknikEntities db)
|
||||||
{
|
{
|
||||||
// Get Biling Service
|
// Get Biling Service
|
||||||
var billingService = BillingFactory.GetBillingService(config.BillingConfig);
|
var billingService = BillingFactory.GetBillingService(config.BillingConfig);
|
||||||
@ -117,6 +118,12 @@ namespace Teknik.BillingService
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Only reset their email size limit if they are premium
|
||||||
|
var userInfo = await IdentityHelper.GetIdentityUserInfo(config, user.Username);
|
||||||
|
if (userInfo != null &&
|
||||||
|
userInfo.AccountType == AccountType.Premium)
|
||||||
|
BillingHelper.SetEmailLimits(config, user, config.EmailConfig.MaxSize, true);
|
||||||
|
else
|
||||||
BillingHelper.SetEmailLimits(config, user, config.EmailConfig.MaxSize, false);
|
BillingHelper.SetEmailLimits(config, user, config.EmailConfig.MaxSize, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,8 @@
|
|||||||
"url": "https://git.teknik.io/Teknikode/Teknik"
|
"url": "https://git.teknik.io/Teknikode/Teknik"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"pre-publish": "npm install && gulp clean && gulp copy-assets && gulp watch",
|
"pre-publish": "npm install && gulp clean && gulp copy-assets",
|
||||||
"build": "npm install && gulp clean && gulp copy-assets && gulp min && gulp update-version",
|
"build": "npm install && gulp eslint && gulp clean && gulp copy-assets && gulp load-bundle && gulp min && gulp update-version",
|
||||||
"gulp": "gulp"
|
"gulp": "gulp"
|
||||||
},
|
},
|
||||||
"version": "2.1.0"
|
"version": "2.1.0"
|
||||||
|
@ -57,8 +57,8 @@
|
|||||||
"url": "https://git.teknik.io/Teknikode/Teknik"
|
"url": "https://git.teknik.io/Teknikode/Teknik"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"pre-publish": "npm install && gulp clean && gulp copy-assets && gulp watch",
|
"pre-publish": "npm install && gulp clean && gulp copy-assets",
|
||||||
"build": "npm install && gulp eslint && gulp clean && gulp copy-assets && gulp min && gulp update-version",
|
"build": "npm install && gulp eslint && gulp clean && gulp copy-assets && gulp load-bundle && gulp min && gulp update-version",
|
||||||
"gulp": "gulp"
|
"gulp": "gulp"
|
||||||
},
|
},
|
||||||
"version": "2.1.0"
|
"version": "2.1.0"
|
||||||
|
Loading…
Reference in New Issue
Block a user