summaryrefslogtreecommitdiffstats
path: root/modules/webhook/matrix.go
diff options
context:
space:
mode:
authorCornel <github@codejuggle.dj>2020-06-26 04:19:11 +0300
committerGitHub <noreply@github.com>2020-06-25 21:19:11 -0400
commit445992d929aa694975db2a7c44975961ece8977b (patch)
tree6d7a52306a748235602dee8e2b900437610b6dd7 /modules/webhook/matrix.go
parentd059156c3a000441de1a040721877060277eb9fe (diff)
downloadgitea-445992d929aa694975db2a7c44975961ece8977b.tar.gz
gitea-445992d929aa694975db2a7c44975961ece8977b.zip
Fix comments webhook panic backport (#12058)
* Handle HookIssueReviewed action in webhook * Fix webhook comment handling type cast panic
Diffstat (limited to 'modules/webhook/matrix.go')
-rw-r--r--modules/webhook/matrix.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/webhook/matrix.go b/modules/webhook/matrix.go
index bf72e6e340..68c65623f7 100644
--- a/modules/webhook/matrix.go
+++ b/modules/webhook/matrix.go
@@ -230,7 +230,11 @@ func GetMatrixPayload(p api.Payloader, event models.HookEventType, meta string)
case models.HookEventIssues, models.HookEventIssueAssign, models.HookEventIssueLabel, models.HookEventIssueMilestone:
return getMatrixIssuesPayload(p.(*api.IssuePayload), matrix)
case models.HookEventIssueComment, models.HookEventPullRequestComment:
- return getMatrixIssueCommentPayload(p.(*api.IssueCommentPayload), matrix)
+ pl, ok := p.(*api.IssueCommentPayload)
+ if ok {
+ return getMatrixIssueCommentPayload(pl, matrix)
+ }
+ return getMatrixPullRequestPayload(p.(*api.PullRequestPayload), matrix)
case models.HookEventPush:
return getMatrixPushPayload(p.(*api.PushPayload), matrix)
case models.HookEventPullRequest, models.HookEventPullRequestAssign, models.HookEventPullRequestLabel,