Free group plan subscription from a party/guild no longer gets cancelled after leaving a guild - fixes #11055 (#11228)

* bug fix: free group plan subscription from party/guild is no longer cancelled when leaving a guild

* free group plan subscription from party/guild no longer gets cancelled when leaving a guild

* bug fix: free group plan subscription from party/guild is no longer cancelled when leaving a guild

* free group plan subscription from party/guild no longer gets cancelled when leaving a guild

* Added tests to check if a member of a group plan maintains free subscription when leaving another group without a plan

* Added tests to check if member of a group plan still keeps free subscription when leaving some other group without a plan

* bug fix: free group plan subscription from party/guild is no longer cancelled when leaving a guild

* free group plan subscription from party/guild no longer gets cancelled when leaving a guild

* bug fix: free group plan subscription from party/guild is no longer cancelled when leaving a guild

* free group plan subscription from party/guild no longer gets cancelled when leaving a guild

* Added tests to check if a member of a group plan maintains free subscription when leaving another group without a plan

* Added tests to check if member of a group plan still keeps free subscription when leaving some other group without a plan
This commit is contained in:
Jawad Jahangir
2019-08-15 21:06:56 +06:00
committed by Sabe Jones
parent f0e6703546
commit 5a83f93ade
4 changed files with 65 additions and 39 deletions

View File

@@ -776,7 +776,7 @@ api.leaveGroup = {
if (group.type !== 'party') {
let guildIndex = user.guilds.indexOf(group._id);
user.guilds.splice(guildIndex, 1);
if (guildIndex >= 0) user.guilds.splice(guildIndex, 1);
}
let isMemberOfGroupPlan = await user.isMemberOfGroupPlan();