Browse Source

Make email sync not remove email account if premium

tags/5.2.0
Teknikode 1 month ago
parent
commit
2e945e7d9d
3 changed files with 13 additions and 6 deletions
  1. 9
    2
      BillingService/Program.cs
  2. 2
    2
      IdentityServer/package.json
  3. 2
    2
      Teknik/package.json

+ 9
- 2
BillingService/Program.cs View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using CommandLine;
using Microsoft.EntityFrameworkCore;
using Teknik.Areas.Billing;
@@ -72,7 +73,7 @@ namespace Teknik.BillingService
return -1;
}

public static void SyncSubscriptions(Config config, TeknikEntities db)
public static async Task SyncSubscriptions(Config config, TeknikEntities db)
{
// Get Biling Service
var billingService = BillingFactory.GetBillingService(config.BillingConfig);
@@ -117,7 +118,13 @@ namespace Teknik.BillingService
}
else
{
BillingHelper.SetEmailLimits(config, user, config.EmailConfig.MaxSize, false);
// 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);
}
}
}

+ 2
- 2
IdentityServer/package.json View File

@@ -35,8 +35,8 @@
"url": "https://git.teknik.io/Teknikode/Teknik"
},
"scripts": {
"pre-publish": "npm install && gulp clean && gulp copy-assets && gulp watch",
"build": "npm install && gulp clean && gulp copy-assets && gulp min && gulp update-version",
"pre-publish": "npm install && gulp clean && gulp copy-assets",
"build": "npm install && gulp eslint && gulp clean && gulp copy-assets && gulp load-bundle && gulp min && gulp update-version",
"gulp": "gulp"
},
"version": "2.1.0"

+ 2
- 2
Teknik/package.json View File

@@ -57,8 +57,8 @@
"url": "https://git.teknik.io/Teknikode/Teknik"
},
"scripts": {
"pre-publish": "npm install && gulp clean && gulp copy-assets && gulp watch",
"build": "npm install && gulp eslint && gulp clean && gulp copy-assets && gulp min && gulp update-version",
"pre-publish": "npm install && gulp clean && gulp copy-assets",
"build": "npm install && gulp eslint && gulp clean && gulp copy-assets && gulp load-bundle && gulp min && gulp update-version",
"gulp": "gulp"
},
"version": "2.1.0"

Loading…
Cancel
Save