@@ -24,27 +24,27 @@ import (
2424)
2525
2626func toBranchLink (act * activities_model.Action ) string {
27- return act .GetRepoLink () + "/src/branch/" + util .PathEscapeSegments (act .GetBranch ())
27+ return act .GetRepoAbsoluteLink () + "/src/branch/" + util .PathEscapeSegments (act .GetBranch ())
2828}
2929
3030func toTagLink (act * activities_model.Action ) string {
31- return act .GetRepoLink () + "/src/tag/" + util .PathEscapeSegments (act .GetTag ())
31+ return act .GetRepoAbsoluteLink () + "/src/tag/" + util .PathEscapeSegments (act .GetTag ())
3232}
3333
3434func toIssueLink (act * activities_model.Action ) string {
35- return act .GetRepoLink () + "/issues/" + url .PathEscape (act .GetIssueInfos ()[0 ])
35+ return act .GetRepoAbsoluteLink () + "/issues/" + url .PathEscape (act .GetIssueInfos ()[0 ])
3636}
3737
3838func toPullLink (act * activities_model.Action ) string {
39- return act .GetRepoLink () + "/pulls/" + url .PathEscape (act .GetIssueInfos ()[0 ])
39+ return act .GetRepoAbsoluteLink () + "/pulls/" + url .PathEscape (act .GetIssueInfos ()[0 ])
4040}
4141
4242func toSrcLink (act * activities_model.Action ) string {
43- return act .GetRepoLink () + "/src/" + util .PathEscapeSegments (act .GetBranch ())
43+ return act .GetRepoAbsoluteLink () + "/src/" + util .PathEscapeSegments (act .GetBranch ())
4444}
4545
4646func toReleaseLink (act * activities_model.Action ) string {
47- return act .GetRepoLink () + "/releases/tag/" + util .PathEscapeSegments (act .GetBranch ())
47+ return act .GetRepoAbsoluteLink () + "/releases/tag/" + util .PathEscapeSegments (act .GetBranch ())
4848}
4949
5050// renderMarkdown creates a minimal markdown render context from an action.
@@ -79,17 +79,17 @@ func feedActionsToFeedItems(ctx *context.Context, actions activities_model.Actio
7979 title = act .ActUser .DisplayName () + " "
8080 switch act .OpType {
8181 case activities_model .ActionCreateRepo :
82- title += ctx .TrHTMLEscapeArgs ("action.create_repo" , act .GetRepoLink (), act .ShortRepoPath ())
83- link .Href = act .GetRepoLink ()
82+ title += ctx .TrHTMLEscapeArgs ("action.create_repo" , act .GetRepoAbsoluteLink (), act .ShortRepoPath ())
83+ link .Href = act .GetRepoAbsoluteLink ()
8484 case activities_model .ActionRenameRepo :
85- title += ctx .TrHTMLEscapeArgs ("action.rename_repo" , act .GetContent (), act .GetRepoLink (), act .ShortRepoPath ())
86- link .Href = act .GetRepoLink ()
85+ title += ctx .TrHTMLEscapeArgs ("action.rename_repo" , act .GetContent (), act .GetRepoAbsoluteLink (), act .ShortRepoPath ())
86+ link .Href = act .GetRepoAbsoluteLink ()
8787 case activities_model .ActionCommitRepo :
8888 link .Href = toBranchLink (act )
8989 if len (act .Content ) != 0 {
90- title += ctx .TrHTMLEscapeArgs ("action.commit_repo" , act .GetRepoLink (), link .Href , act .GetBranch (), act .ShortRepoPath ())
90+ title += ctx .TrHTMLEscapeArgs ("action.commit_repo" , act .GetRepoAbsoluteLink (), link .Href , act .GetBranch (), act .ShortRepoPath ())
9191 } else {
92- title += ctx .TrHTMLEscapeArgs ("action.create_branch" , act .GetRepoLink (), link .Href , act .GetBranch (), act .ShortRepoPath ())
92+ title += ctx .TrHTMLEscapeArgs ("action.create_branch" , act .GetRepoAbsoluteLink (), link .Href , act .GetBranch (), act .ShortRepoPath ())
9393 }
9494 case activities_model .ActionCreateIssue :
9595 link .Href = toIssueLink (act )
@@ -98,11 +98,11 @@ func feedActionsToFeedItems(ctx *context.Context, actions activities_model.Actio
9898 link .Href = toPullLink (act )
9999 title += ctx .TrHTMLEscapeArgs ("action.create_pull_request" , link .Href , act .GetIssueInfos ()[0 ], act .ShortRepoPath ())
100100 case activities_model .ActionTransferRepo :
101- link .Href = act .GetRepoLink ()
102- title += ctx .TrHTMLEscapeArgs ("action.transfer_repo" , act .GetContent (), act .GetRepoLink (), act .ShortRepoPath ())
101+ link .Href = act .GetRepoAbsoluteLink ()
102+ title += ctx .TrHTMLEscapeArgs ("action.transfer_repo" , act .GetContent (), act .GetRepoAbsoluteLink (), act .ShortRepoPath ())
103103 case activities_model .ActionPushTag :
104104 link .Href = toTagLink (act )
105- title += ctx .TrHTMLEscapeArgs ("action.push_tag" , act .GetRepoLink (), link .Href , act .GetTag (), act .ShortRepoPath ())
105+ title += ctx .TrHTMLEscapeArgs ("action.push_tag" , act .GetRepoAbsoluteLink (), link .Href , act .GetTag (), act .ShortRepoPath ())
106106 case activities_model .ActionCommentIssue :
107107 issueLink := toIssueLink (act )
108108 if link .Href == "#" {
@@ -140,26 +140,26 @@ func feedActionsToFeedItems(ctx *context.Context, actions activities_model.Actio
140140 }
141141 title += ctx .TrHTMLEscapeArgs ("action.reopen_pull_request" , pullLink , act .GetIssueInfos ()[0 ], act .ShortRepoPath ())
142142 case activities_model .ActionDeleteTag :
143- link .Href = act .GetRepoLink ()
144- title += ctx .TrHTMLEscapeArgs ("action.delete_tag" , act .GetRepoLink (), act .GetTag (), act .ShortRepoPath ())
143+ link .Href = act .GetRepoAbsoluteLink ()
144+ title += ctx .TrHTMLEscapeArgs ("action.delete_tag" , act .GetRepoAbsoluteLink (), act .GetTag (), act .ShortRepoPath ())
145145 case activities_model .ActionDeleteBranch :
146- link .Href = act .GetRepoLink ()
147- title += ctx .TrHTMLEscapeArgs ("action.delete_branch" , act .GetRepoLink (), html .EscapeString (act .GetBranch ()), act .ShortRepoPath ())
146+ link .Href = act .GetRepoAbsoluteLink ()
147+ title += ctx .TrHTMLEscapeArgs ("action.delete_branch" , act .GetRepoAbsoluteLink (), html .EscapeString (act .GetBranch ()), act .ShortRepoPath ())
148148 case activities_model .ActionMirrorSyncPush :
149149 srcLink := toSrcLink (act )
150150 if link .Href == "#" {
151151 link .Href = srcLink
152152 }
153- title += ctx .TrHTMLEscapeArgs ("action.mirror_sync_push" , act .GetRepoLink (), srcLink , act .GetBranch (), act .ShortRepoPath ())
153+ title += ctx .TrHTMLEscapeArgs ("action.mirror_sync_push" , act .GetRepoAbsoluteLink (), srcLink , act .GetBranch (), act .ShortRepoPath ())
154154 case activities_model .ActionMirrorSyncCreate :
155155 srcLink := toSrcLink (act )
156156 if link .Href == "#" {
157157 link .Href = srcLink
158158 }
159- title += ctx .TrHTMLEscapeArgs ("action.mirror_sync_create" , act .GetRepoLink (), srcLink , act .GetBranch (), act .ShortRepoPath ())
159+ title += ctx .TrHTMLEscapeArgs ("action.mirror_sync_create" , act .GetRepoAbsoluteLink (), srcLink , act .GetBranch (), act .ShortRepoPath ())
160160 case activities_model .ActionMirrorSyncDelete :
161- link .Href = act .GetRepoLink ()
162- title += ctx .TrHTMLEscapeArgs ("action.mirror_sync_delete" , act .GetRepoLink (), act .GetBranch (), act .ShortRepoPath ())
161+ link .Href = act .GetRepoAbsoluteLink ()
162+ title += ctx .TrHTMLEscapeArgs ("action.mirror_sync_delete" , act .GetRepoAbsoluteLink (), act .GetBranch (), act .ShortRepoPath ())
163163 case activities_model .ActionApprovePullRequest :
164164 pullLink := toPullLink (act )
165165 title += ctx .TrHTMLEscapeArgs ("action.approve_pull_request" , pullLink , act .GetIssueInfos ()[0 ], act .ShortRepoPath ())
@@ -174,16 +174,16 @@ func feedActionsToFeedItems(ctx *context.Context, actions activities_model.Actio
174174 if link .Href == "#" {
175175 link .Href = releaseLink
176176 }
177- title += ctx .TrHTMLEscapeArgs ("action.publish_release" , act .GetRepoLink (), releaseLink , act .ShortRepoPath (), act .Content )
177+ title += ctx .TrHTMLEscapeArgs ("action.publish_release" , act .GetRepoAbsoluteLink (), releaseLink , act .ShortRepoPath (), act .Content )
178178 case activities_model .ActionPullReviewDismissed :
179179 pullLink := toPullLink (act )
180180 title += ctx .TrHTMLEscapeArgs ("action.review_dismissed" , pullLink , act .GetIssueInfos ()[0 ], act .ShortRepoPath (), act .GetIssueInfos ()[1 ])
181181 case activities_model .ActionStarRepo :
182- link .Href = act .GetRepoLink ()
183- title += ctx .TrHTMLEscapeArgs ("action.starred_repo" , act .GetRepoLink (), act .GetRepoPath ())
182+ link .Href = act .GetRepoAbsoluteLink ()
183+ title += ctx .TrHTMLEscapeArgs ("action.starred_repo" , act .GetRepoAbsoluteLink (), act .GetRepoPath ())
184184 case activities_model .ActionWatchRepo :
185- link .Href = act .GetRepoLink ()
186- title += ctx .TrHTMLEscapeArgs ("action.watched_repo" , act .GetRepoLink (), act .GetRepoPath ())
185+ link .Href = act .GetRepoAbsoluteLink ()
186+ title += ctx .TrHTMLEscapeArgs ("action.watched_repo" , act .GetRepoAbsoluteLink (), act .GetRepoPath ())
187187 default :
188188 return nil , fmt .Errorf ("unknown action type: %v" , act .OpType )
189189 }
@@ -193,14 +193,14 @@ func feedActionsToFeedItems(ctx *context.Context, actions activities_model.Actio
193193 switch act .OpType {
194194 case activities_model .ActionCommitRepo , activities_model .ActionMirrorSyncPush :
195195 push := templates .ActionContent2Commits (act )
196- repoLink := act .GetRepoLink ()
196+ repoLink := act .GetRepoAbsoluteLink ()
197197
198198 for _ , commit := range push .Commits {
199199 if len (desc ) != 0 {
200200 desc += "\n \n "
201201 }
202202 desc += fmt .Sprintf ("<a href=\" %s\" >%s</a>\n %s" ,
203- html .EscapeString (fmt .Sprintf ("%s/commit/%s" , act .GetRepoLink (), commit .Sha1 )),
203+ html .EscapeString (fmt .Sprintf ("%s/commit/%s" , act .GetRepoAbsoluteLink (), commit .Sha1 )),
204204 commit .Sha1 ,
205205 templates .RenderCommitMessage (ctx , commit .Message , repoLink , nil ),
206206 )
@@ -209,7 +209,7 @@ func feedActionsToFeedItems(ctx *context.Context, actions activities_model.Actio
209209 if push .Len > 1 {
210210 link = & feeds.Link {Href : fmt .Sprintf ("%s/%s" , setting .AppSubURL , push .CompareURL )}
211211 } else if push .Len == 1 {
212- link = & feeds.Link {Href : fmt .Sprintf ("%s/commit/%s" , act .GetRepoLink (), push .Commits [0 ].Sha1 )}
212+ link = & feeds.Link {Href : fmt .Sprintf ("%s/commit/%s" , act .GetRepoAbsoluteLink (), push .Commits [0 ].Sha1 )}
213213 }
214214
215215 case activities_model .ActionCreateIssue , activities_model .ActionCreatePullRequest :
0 commit comments