Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions db/mapset_ranking_queue_comments.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,15 @@ func (c *MapsetRankingQueueComment) Edit(comment string) error {
func GetRankingQueueComments(mapsetId int, includePrivate bool) ([]*MapsetRankingQueueComment, error) {
var comments = make([]*MapsetRankingQueueComment, 0)

result := SQL.
query := SQL.
Joins("User").
Where("mapset_id = ? AND is_private = ?", mapsetId, includePrivate).
Where("mapset_id = ?", mapsetId)

if !includePrivate {
query = query.Where("is_private = ?", false)
}

result := query.
Order("id DESC").
Find(&comments)

Expand Down
2 changes: 1 addition & 1 deletion handlers/ranking_comments.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func prepareRankingQueueCommentsForResponse(comments []*db.MapsetRankingQueueCom
prepared := make([]*db.MapsetRankingQueueComment, 0, len(comments))

for _, comment := range comments {
if !canViewPrivate {
if comment.IsPrivate && !canViewPrivate {
continue
}

Expand Down
Loading