Virtual user gitea-bots

This commit is contained in:
Lunny Xiao
2022-10-31 13:22:28 +08:00
committed by Jason Song
parent 1e209973ee
commit 339ddf4c5f
3 changed files with 26 additions and 17 deletions

View File

@ -577,6 +577,13 @@ func (u *User) IsGhost() bool {
return u.ID == -1 && u.Name == "Ghost"
}
func (u *User) IsBots() bool {
if u == nil {
return false
}
return u.ID == -2 && u.Name == "gitea-bots"
}
var (
reservedUsernames = []string{
".",