|
|
@ -27,7 +27,7 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread { |
|
|
|
//handle Subject
|
|
|
|
//handle Subject
|
|
|
|
switch n.Source { |
|
|
|
switch n.Source { |
|
|
|
case models.NotificationSourceIssue: |
|
|
|
case models.NotificationSourceIssue: |
|
|
|
result.Subject = &api.NotificationSubject{Type: "Issue"} |
|
|
|
result.Subject = &api.NotificationSubject{Type: api.NotifySubjectIssue} |
|
|
|
if n.Issue != nil { |
|
|
|
if n.Issue != nil { |
|
|
|
result.Subject.Title = n.Issue.Title |
|
|
|
result.Subject.Title = n.Issue.Title |
|
|
|
result.Subject.URL = n.Issue.APIURL() |
|
|
|
result.Subject.URL = n.Issue.APIURL() |
|
|
@ -38,7 +38,7 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
case models.NotificationSourcePullRequest: |
|
|
|
case models.NotificationSourcePullRequest: |
|
|
|
result.Subject = &api.NotificationSubject{Type: "Pull"} |
|
|
|
result.Subject = &api.NotificationSubject{Type: api.NotifySubjectPull} |
|
|
|
if n.Issue != nil { |
|
|
|
if n.Issue != nil { |
|
|
|
result.Subject.Title = n.Issue.Title |
|
|
|
result.Subject.Title = n.Issue.Title |
|
|
|
result.Subject.URL = n.Issue.APIURL() |
|
|
|
result.Subject.URL = n.Issue.APIURL() |
|
|
@ -55,13 +55,13 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread { |
|
|
|
} |
|
|
|
} |
|
|
|
case models.NotificationSourceCommit: |
|
|
|
case models.NotificationSourceCommit: |
|
|
|
result.Subject = &api.NotificationSubject{ |
|
|
|
result.Subject = &api.NotificationSubject{ |
|
|
|
Type: "Commit", |
|
|
|
Type: api.NotifySubjectCommit, |
|
|
|
Title: n.CommitID, |
|
|
|
Title: n.CommitID, |
|
|
|
URL: n.Repository.HTMLURL() + "/commit/" + n.CommitID, |
|
|
|
URL: n.Repository.HTMLURL() + "/commit/" + n.CommitID, |
|
|
|
} |
|
|
|
} |
|
|
|
case models.NotificationSourceRepository: |
|
|
|
case models.NotificationSourceRepository: |
|
|
|
result.Subject = &api.NotificationSubject{ |
|
|
|
result.Subject = &api.NotificationSubject{ |
|
|
|
Type: "Repository", |
|
|
|
Type: api.NotifySubjectRepository, |
|
|
|
Title: n.Repository.FullName(), |
|
|
|
Title: n.Repository.FullName(), |
|
|
|
URL: n.Repository.Link(), |
|
|
|
URL: n.Repository.Link(), |
|
|
|
} |
|
|
|
} |
|
|
|