Chat reports: attach target user ID table
This commit is contained in:
parent
dc5b82b59a
commit
5f5fe37350
|
@ -104,6 +104,15 @@ func Report() http.HandlerFunc {
|
|||
currentUser = nil
|
||||
}
|
||||
|
||||
// Look up the AboutUser ID if possible.
|
||||
targetUser, err := models.FindUser(report.AboutUsername)
|
||||
if err == nil {
|
||||
fb.TableName = "users"
|
||||
fb.TableID = targetUser.ID
|
||||
} else {
|
||||
log.Error("BareRTC Chat Feedback: couldn't find user ID for AboutUsername=%s: %s", report.AboutUsername, err)
|
||||
}
|
||||
|
||||
// Save the feedback.
|
||||
if err := models.CreateFeedback(fb); err != nil {
|
||||
log.Error("Couldn't save feedback from BareRTC report endpoint: %s", err)
|
||||
|
|
Loading…
Reference in New Issue
Block a user