mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-27 19:13:33 -06:00
[bugfix] Fix broken only_media and only_public flags on /api/v1/accounts/:id/statuses (#448)
* bump superseriousbusiness/activity version * fetch list of follower inbox iris * add test for getting account statuses * fix incorrect publicOnly parsing * update media not null query
This commit is contained in:
parent
707de094a0
commit
a7e9dee33d
4 changed files with 93 additions and 5 deletions
|
|
@ -263,10 +263,16 @@ func (a *accountDB) GetAccountStatuses(ctx context.Context, accountID string, li
|
|||
}
|
||||
|
||||
if mediaOnly {
|
||||
// attachments are stored as a json object;
|
||||
// this implementation differs between sqlite and postgres,
|
||||
// so we have to be very thorough to cover all eventualities
|
||||
q = q.WhereGroup(" AND ", func(q *bun.SelectQuery) *bun.SelectQuery {
|
||||
return q.
|
||||
WhereOr("? IS NOT NULL", bun.Ident("attachments")).
|
||||
WhereOr("attachments != '{}'")
|
||||
Where("? IS NOT NULL", bun.Ident("attachments")).
|
||||
Where("? != ''", bun.Ident("attachments")).
|
||||
Where("? != 'null'", bun.Ident("attachments")).
|
||||
Where("? != '{}'", bun.Ident("attachments")).
|
||||
Where("? != '[]'", bun.Ident("attachments"))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue