mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	#2045 add short version as fallback to Slack payload
This commit is contained in:
		@@ -33,8 +33,9 @@ type SlackPayload struct {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type SlackAttachment struct {
 | 
					type SlackAttachment struct {
 | 
				
			||||||
	Color string `json:"color"`
 | 
						Fallback string `json:"fallback"`
 | 
				
			||||||
	Text  string `json:"text"`
 | 
						Color    string `json:"color"`
 | 
				
			||||||
 | 
						Text     string `json:"text"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (p *SlackPayload) SetSecret(_ string) {}
 | 
					func (p *SlackPayload) SetSecret(_ string) {}
 | 
				
			||||||
@@ -111,7 +112,12 @@ func getSlackPushPayload(p *api.PushPayload, slack *SlackMeta) (*SlackPayload, e
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	slackAttachments := []SlackAttachment{{Color: slack.Color, Text: attachmentText}}
 | 
						slackAttachments := []SlackAttachment{{
 | 
				
			||||||
 | 
							Fallback: fmt.Sprintf("%s pushed %s to %s/%s: %s",
 | 
				
			||||||
 | 
								p.Pusher, commitString, p.Repo.Name, branchName, p.CompareUrl),
 | 
				
			||||||
 | 
							Color: slack.Color,
 | 
				
			||||||
 | 
							Text:  attachmentText,
 | 
				
			||||||
 | 
						}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return &SlackPayload{
 | 
						return &SlackPayload{
 | 
				
			||||||
		Channel:     slack.Channel,
 | 
							Channel:     slack.Channel,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user