This commit is contained in:
Konrad 2017-11-01 11:45:13 +01:00
parent 6b3a51abaa
commit 2dca487e0b
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B
2 changed files with 51 additions and 51 deletions

View File

@ -79,23 +79,23 @@ const (
// Comment represents a comment in commit and issue page. // Comment represents a comment in commit and issue page.
type Comment struct { type Comment struct {
ID int64 `xorm:"pk autoincr"` ID int64 `xorm:"pk autoincr"`
Type CommentType Type CommentType
PosterID int64 `xorm:"INDEX"` PosterID int64 `xorm:"INDEX"`
Poster *User `xorm:"-"` Poster *User `xorm:"-"`
IssueID int64 `xorm:"INDEX"` IssueID int64 `xorm:"INDEX"`
LabelID int64 LabelID int64
Label *Label `xorm:"-"` Label *Label `xorm:"-"`
OldMilestoneID int64 OldMilestoneID int64
MilestoneID int64 MilestoneID int64
OldMilestone *Milestone `xorm:"-"` OldMilestone *Milestone `xorm:"-"`
Milestone *Milestone `xorm:"-"` Milestone *Milestone `xorm:"-"`
OldAssigneeID int64 OldAssigneeID int64
AssigneeID int64 AssigneeID int64
Assignee *User `xorm:"-"` Assignee *User `xorm:"-"`
OldAssignee *User `xorm:"-"` OldAssignee *User `xorm:"-"`
OldTitle string OldTitle string
NewTitle string NewTitle string
DependentIssueID int64 DependentIssueID int64
DependentIssue *Issue `xorm:"-"` DependentIssue *Issue `xorm:"-"`
@ -317,21 +317,21 @@ func createComment(e *xorm.Session, opts *CreateCommentOptions) (_ *Comment, err
} }
comment := &Comment{ comment := &Comment{
Type: opts.Type, Type: opts.Type,
PosterID: opts.Doer.ID, PosterID: opts.Doer.ID,
Poster: opts.Doer, Poster: opts.Doer,
IssueID: opts.Issue.ID, IssueID: opts.Issue.ID,
LabelID: LabelID, LabelID: LabelID,
OldMilestoneID: opts.OldMilestoneID, OldMilestoneID: opts.OldMilestoneID,
MilestoneID: opts.MilestoneID, MilestoneID: opts.MilestoneID,
OldAssigneeID: opts.OldAssigneeID, OldAssigneeID: opts.OldAssigneeID,
AssigneeID: opts.AssigneeID, AssigneeID: opts.AssigneeID,
CommitID: opts.CommitID, CommitID: opts.CommitID,
CommitSHA: opts.CommitSHA, CommitSHA: opts.CommitSHA,
Line: opts.LineNum, Line: opts.LineNum,
Content: opts.Content, Content: opts.Content,
OldTitle: opts.OldTitle, OldTitle: opts.OldTitle,
NewTitle: opts.NewTitle, NewTitle: opts.NewTitle,
DependentIssue: opts.DependentIssue, DependentIssue: opts.DependentIssue,
DependentIssueID: depID, DependentIssueID: depID,
} }
@ -525,11 +525,11 @@ func createIssueDependencyComment(e *xorm.Session, doer *User, issue *Issue, dep
// CreateCommentOptions defines options for creating comment // CreateCommentOptions defines options for creating comment
type CreateCommentOptions struct { type CreateCommentOptions struct {
Type CommentType Type CommentType
Doer *User Doer *User
Repo *Repository Repo *Repository
Issue *Issue Issue *Issue
Label *Label Label *Label
DependentIssue *Issue DependentIssue *Issue
OldMilestoneID int64 OldMilestoneID int64

View File

@ -9,13 +9,13 @@ type UnitType int
// Enumerate all the unit types // Enumerate all the unit types
const ( const (
UnitTypeCode UnitType = iota + 1 // 1 code UnitTypeCode UnitType = iota + 1 // 1 code
UnitTypeIssues // 2 issues UnitTypeIssues // 2 issues
UnitTypePullRequests // 3 PRs UnitTypePullRequests // 3 PRs
UnitTypeReleases // 4 Releases UnitTypeReleases // 4 Releases
UnitTypeWiki // 5 Wiki UnitTypeWiki // 5 Wiki
UnitTypeExternalWiki // 6 ExternalWiki UnitTypeExternalWiki // 6 ExternalWiki
UnitTypeExternalTracker // 7 ExternalTracker UnitTypeExternalTracker // 7 ExternalTracker
UnitTypeIssueDependencies // 8 Issue Dependencies UnitTypeIssueDependencies // 8 Issue Dependencies
) )
@ -138,13 +138,13 @@ var (
// Units contains all the units // Units contains all the units
Units = map[UnitType]Unit{ Units = map[UnitType]Unit{
UnitTypeCode: UnitCode, UnitTypeCode: UnitCode,
UnitTypeIssues: UnitIssues, UnitTypeIssues: UnitIssues,
UnitTypeExternalTracker: UnitExternalTracker, UnitTypeExternalTracker: UnitExternalTracker,
UnitTypePullRequests: UnitPullRequests, UnitTypePullRequests: UnitPullRequests,
UnitTypeReleases: UnitReleases, UnitTypeReleases: UnitReleases,
UnitTypeWiki: UnitWiki, UnitTypeWiki: UnitWiki,
UnitTypeExternalWiki: UnitExternalWiki, UnitTypeExternalWiki: UnitExternalWiki,
UnitTypeIssueDependencies: UnitIssueDependencies, UnitTypeIssueDependencies: UnitIssueDependencies,
} }
) )