From b0615f4a3bd6072a84e5237cac4230615f417af0 Mon Sep 17 00:00:00 2001 From: Simon Esposito Date: Tue, 8 Oct 2024 18:12:07 +0100 Subject: [PATCH] Correctly filter purchases in console account view. (#1273) Only display purchases owned by the account being viewed. --- CHANGELOG.md | 1 + server/core_purchase.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a8fd447e..41e502a66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr ### Fixed - Ensure matchmaker stats behave correctly if matchmaker becomes fully empty and idle. - Correctly clear rank cache entries on account deletion. +- Only display owned purchases in the console account tab. ## [3.23.0] - 2024-07-27 ### Added diff --git a/server/core_purchase.go b/server/core_purchase.go index 5fe4145f4..b63fff360 100644 --- a/server/core_purchase.go +++ b/server/core_purchase.go @@ -532,7 +532,12 @@ LIMIT $4` } params = append(params, incomingCursor.PurchaseTime.AsTime(), incomingCursor.UserId, incomingCursor.TransactionId) } else { - query += " ORDER BY purchase_time DESC, user_id DESC, transaction_id DESC LIMIT $1" + if userID == "" { + query += " ORDER BY purchase_time DESC, user_id DESC, transaction_id DESC LIMIT $1" + } else { + query += " WHERE user_id = $1 ORDER BY purchase_time DESC, user_id DESC, transaction_id DESC LIMIT $2" + params = append(params, userID) + } } if limit > 0 {