]> source.dussan.org Git - gitea.git/commit
fix incorrect role labels for migrated issues and comments (#22914)
authorZettat123 <zettat123@gmail.com>
Wed, 15 Feb 2023 17:29:13 +0000 (01:29 +0800)
committerGitHub <noreply@github.com>
Wed, 15 Feb 2023 17:29:13 +0000 (12:29 -0500)
commit0ab22a1a020865c9906487cf7735796ff01c4fd2
treec591b41ca81d6b8d5211eec36844f1e1977f9dce
parent2c04595762b5c6ecfef8a32b05de7a5ef5f7066c
fix incorrect role labels for migrated issues and comments (#22914)

Fix #22797.

## Reason
If a comment was migrated from other platforms, this comment may have an
original author and its poster is always not the original author. When
the `roleDescriptor` func get the poster's role descriptor for a
comment, it does not check if the comment has an original author. So the
migrated comments' original authors might be marked as incorrect roles.

---------

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
models/issues/comment.go
models/issues/issue.go
routers/web/repo/issue.go