diff --git a/pkg/controller/api/barertc/barertc_webhooks.go b/pkg/controller/api/barertc/barertc_webhooks.go index d9913db..6ab358e 100644 --- a/pkg/controller/api/barertc/barertc_webhooks.go +++ b/pkg/controller/api/barertc/barertc_webhooks.go @@ -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)