superseriousbusiness / gotosocial

Fast, fun, small ActivityPub server.
https://docs.gotosocial.org
GNU Affero General Public License v3.0
3.66k stars 309 forks source link

[bug] Report Category always shows as "other" #2679

Open moan0s opened 6 months ago

moan0s commented 6 months ago

Describe the bug with a clear and concise description of what the bug is.

When a post is reported for breach of a specific server rule this rule is not shown in the admin interface.

What's your GoToSocial Version?

v0.13.3 git-fb3e3ca

GoToSocial Arch

docker x86_64

What happened?

see steps to reproduce

What you expected to happen?

I expect to be shown the rule that was breached.

How to reproduce it?

Anything else we need to know?

Tested with elk.zone by me and a development version of phanpy.social by Chee Aun. Semaphore and Tusky don't seem to be able to report specific server rules.

tsmethurst commented 6 months ago

Oh thanks. Not a bug really, it's just not implemented yet :P

moan0s commented 6 months ago

Okay, thanks for clarifying! I was pleasantly surprised that server rules were implemented at least partially and I'll happily wait for other features :)

Edit: I also checked the database with SELECT created_at, account_id, comment, rules FROM reports; which confirmed that the rule that was broken is already recorded (and helped test the phanpy implementation). A bit more in depth

 SELECT
      r.created_at,
      a.username,
      r.comment,
      r.rules,
      ru.text AS rule_text,
      ru.id AS id
FROM reports r
CROSS JOIN LATERAL unnest(r.rules) AS rule_id
JOIN rules ru ON ru.id = rule_id
JOIN accounts a ON r.account_id = a.id;