Skip to content

Commit

Permalink
Jira's autolink should support issue links that contain a comment lin…
Browse files Browse the repository at this point in the history
…k in the URL (mattermost#773)

* handling wh.notifications array is empty
* fixing shouldNotReceiveNotification condition
  • Loading branch information
jupriano committed Sep 2, 2021
1 parent d046db9 commit 2325e8e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ func (wh *webhook) getConnection(p *Plugin, instance Instance, notification webh
}

func (wh *webhook) CheckIssueWatchers(p *Plugin, instanceID types.ID) {
if len(wh.notifications) == 0 {
return
}

instance, err := p.instanceStore.LoadInstance(instanceID)
if err != nil {
// This isn't an internal server error. There's just no instance installed.
Expand Down Expand Up @@ -228,7 +232,7 @@ func (wh *webhook) CheckIssueWatchers(p *Plugin, instanceID types.ID) {
postType = notification.postType
message = notification.message
}
if !shouldNotReceiveNotification {
if shouldNotReceiveNotification {
continue
}
whUserNotification := webhookUserNotification{
Expand Down

0 comments on commit 2325e8e

Please sign in to comment.