Browse Source

#2225

remove issueTittle from ActionShow
tags/v1.22.9.2^2
chenyifan01 3 years ago
parent
commit
3a0aa205af
1 changed files with 19 additions and 3 deletions
  1. +19
    -3
      models/action.go

+ 19
- 3
models/action.go View File

@@ -101,7 +101,6 @@ type ActionShow struct {
RefName string
IssueInfos []string
CommentLink string
IssueTitle string
Cloudbrain *CloudbrainShow4Action
}

@@ -246,9 +245,8 @@ func (a *Action) ToShow() *ActionShow {
actionShow.Content = a.Content
actionShow.RefName = a.RefName

if strings.Contains(a.Content, "|") {
if strings.Contains(a.Content, "|") && a.IsIssueAction() {
actionShow.IssueInfos = a.GetIssueInfos()
actionShow.IssueTitle = a.GetIssueTitle()
}

if a.Repo != nil {
@@ -390,6 +388,24 @@ func (a *Action) IsCloudbrainAction() bool {
return false
}

func (a *Action) IsIssueAction() bool {
switch a.OpType {
case ActionCreateIssue,
ActionCloseIssue,
ActionClosePullRequest,
ActionReopenIssue,
ActionReopenPullRequest,
ActionCommentPull,
ActionCommentIssue,
ActionCreatePullRequest,
ActionApprovePullRequest,
ActionRejectPullRequest,
ActionMergePullRequest:
return true
}
return false
}

// GetFeedsOptions options for retrieving feeds
type GetFeedsOptions struct {
RequestedUser *User // the user we want activity for


Loading…
Cancel
Save