discuitnet / discuit

A free and open-source community discussion platform.
https://discuit.net
GNU Affero General Public License v3.0
384 stars 40 forks source link

Feature: notifications for reports #82

Open Codycody31 opened 1 month ago

Codycody31 commented 1 month ago

When content is now reported, notifications will be sent out to the mods of the community

Codycody31 commented 1 month ago

https://github.com/Codycody31/discuit/blob/af1a793a88ddb192e30d956d728994185fbd3165/core/notification.go#L583-L603 seems to be causing the issue, so when the report doesn't exist it returns no bytes (I think) resulting in no information being able to be displayed due to it just crashing. So will have to write some logic to attempt a fallback to instead use ContentID & ContentType to see if we can get some information on it, however not even sure about that. Probably will halt here for this notification stuff for a few days unless @previnder can come in and assist or I find a good way to do this as I don't really have the understanding of how to implement a good fix