summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/issues/comment.go5
-rw-r--r--models/issues/issue.go5
2 files changed, 10 insertions, 0 deletions
diff --git a/models/issues/comment.go b/models/issues/comment.go
index c935e4ac91..36e7b8e785 100644
--- a/models/issues/comment.go
+++ b/models/issues/comment.go
@@ -1244,3 +1244,8 @@ func FixCommentTypeLabelWithOutsideLabels(ctx context.Context) (int64, error) {
return res.RowsAffected()
}
+
+// HasOriginalAuthor returns if a comment was migrated and has an original author.
+func (c *Comment) HasOriginalAuthor() bool {
+ return c.OriginalAuthor != "" && c.OriginalAuthorID != 0
+}
diff --git a/models/issues/issue.go b/models/issues/issue.go
index 62b936331b..e0dcf3d269 100644
--- a/models/issues/issue.go
+++ b/models/issues/issue.go
@@ -2403,3 +2403,8 @@ func DeleteOrphanedIssues(ctx context.Context) error {
}
return nil
}
+
+// HasOriginalAuthor returns if an issue was migrated and has an original author.
+func (issue *Issue) HasOriginalAuthor() bool {
+ return issue.OriginalAuthor != "" && issue.OriginalAuthorID != 0
+}