Skip to content

Commit

Permalink
MI-811: Use TinyURL for page URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
chetanyakan committed Feb 12, 2020
1 parent e46727d commit 21617e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions server/serializer/confluence_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ func (e *ConfluenceServerEvent) GetPageDisplayName(withLink bool) string {
}

name := e.Page.Title
if withLink && e.Page.URL != "" {
name = fmt.Sprintf("[%s](%s)", name, e.Page.URL)
if withLink && e.Page.TinyURL != "" {
name = fmt.Sprintf("[%s](%s)", name, e.Page.TinyURL)
}

return name
Expand Down
6 changes: 3 additions & 3 deletions server/service/confluence_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func generateConfluenceServerNotificationPost(event *serializer.ConfluenceServer
Fallback: message,
Pretext: message,
Title: event.Page.Title,
TitleLink: event.Page.URL,
Text: fmt.Sprintf("%s\n\n[**View in Confluence**](%s)", strings.TrimSpace(event.Page.Excerpt), event.Page.URL),
TitleLink: event.Page.TinyURL,
Text: fmt.Sprintf("%s\n\n[**View in Confluence**](%s)", strings.TrimSpace(event.Page.Excerpt), event.Page.TinyURL),
}
} else {
post.Message = fmt.Sprintf(confluenceServerPageCreatedWithoutBodyMessage, event.GetUserDisplayName(true), event.GetPageDisplayName(true), event.GetSpaceDisplayName(true))
Expand All @@ -61,7 +61,7 @@ func generateConfluenceServerNotificationPost(event *serializer.ConfluenceServer
attachment = &model.SlackAttachment{
Fallback: message,
Pretext: message,
Text: fmt.Sprintf("**What’s Changed?**\n> %s\n\n[**View in Confluence**](%s)", strings.TrimSpace(event.VersionComment), event.Page.URL),
Text: fmt.Sprintf("**What’s Changed?**\n> %s\n\n[**View in Confluence**](%s)", strings.TrimSpace(event.VersionComment), event.Page.TinyURL),
}
} else {
post.Message = message
Expand Down

0 comments on commit 21617e1

Please sign in to comment.