@@ -31,21 +31,25 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread {
3131 if n .Issue != nil {
3232 result .Subject .Title = n .Issue .Title
3333 result .Subject .URL = n .Issue .APIURL ()
34+ result .Subject .HTMLURL = n .Issue .HTMLURL ()
3435 result .Subject .State = n .Issue .State ()
3536 comment , err := n .Issue .GetLastComment ()
3637 if err == nil && comment != nil {
3738 result .Subject .LatestCommentURL = comment .APIURL ()
39+ result .Subject .LatestCommentHTMLURL = comment .HTMLURL ()
3840 }
3941 }
4042 case models .NotificationSourcePullRequest :
4143 result .Subject = & api.NotificationSubject {Type : api .NotifySubjectPull }
4244 if n .Issue != nil {
4345 result .Subject .Title = n .Issue .Title
4446 result .Subject .URL = n .Issue .APIURL ()
47+ result .Subject .HTMLURL = n .Issue .HTMLURL ()
4548 result .Subject .State = n .Issue .State ()
4649 comment , err := n .Issue .GetLastComment ()
4750 if err == nil && comment != nil {
4851 result .Subject .LatestCommentURL = comment .APIURL ()
52+ result .Subject .LatestCommentHTMLURL = comment .HTMLURL ()
4953 }
5054
5155 pr , _ := n .Issue .GetPullRequest ()
@@ -54,16 +58,20 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread {
5458 }
5559 }
5660 case models .NotificationSourceCommit :
61+ url := n .Repository .HTMLURL () + "/commit/" + n .CommitID
5762 result .Subject = & api.NotificationSubject {
58- Type : api .NotifySubjectCommit ,
59- Title : n .CommitID ,
60- URL : n .Repository .HTMLURL () + "/commit/" + n .CommitID ,
63+ Type : api .NotifySubjectCommit ,
64+ Title : n .CommitID ,
65+ URL : url ,
66+ HTMLURL : url ,
6167 }
6268 case models .NotificationSourceRepository :
6369 result .Subject = & api.NotificationSubject {
6470 Type : api .NotifySubjectRepository ,
6571 Title : n .Repository .FullName (),
66- URL : n .Repository .Link (),
72+ // FIXME: this is a relative URL, rather useless and inconsistent, but keeping for backwards compat
73+ URL : n .Repository .Link (),
74+ HTMLURL : n .Repository .HTMLURL (),
6775 }
6876 }
6977
0 commit comments