Skip to content

Commit

Permalink
added message web url to the notification
Browse files Browse the repository at this point in the history
  • Loading branch information
tp-Sebastian-Bogan committed May 19, 2020
1 parent a562a86 commit 02b0f50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type YammerMessage struct {
ClientURL string `json:"client_url"`
DirectMessage bool `json:"direct_message"`
Privacy string `json:"privacy"`
WebUrl string `json:"web_url"`
}

type YammerMessageResponse struct {
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ func (app *app) handleMessages(groupName string, messages []*internal.Message, c
}

summary := user.FullName
body := message.Body.Plain
body := fmt.Sprintf("%s\n\n%s", message.Body.Plain, message.WebUrl)
if len(messages) > 1 {
body = fmt.Sprintf("%s\n... and %d more", body, len(messages)-1)
body = fmt.Sprintf("%s\n\n... and %d more", body, len(messages)-1)
}

internal.Notify(summary, body, myIcon)
Expand Down

0 comments on commit 02b0f50

Please sign in to comment.