-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace -1 with GhostUserID #27703
Replace -1 with GhostUserID #27703
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reading NewReplaceUser
and IsGhost
, I do not think ID == -1
means IsGhost
.
At least one of them should be fixed.
So the func (u *User) IsGhost() bool {
if u == nil {
return false
}
return u.ID == -1 && u.Name == "Ghost"
} But it's better to separate them. |
Update: use 0 to indicate the user is fake |
* upstream/main: Fix incorrect ctx usage in defer function (go-gitea#27740) Enable followCursor for language stats bar (go-gitea#27713) teams: new View button (go-gitea#27685) fix issues in translation file (go-gitea#27699) Fix an indentation in the Chinese documentation of Act Runner (go-gitea#27730) [skip ci] Updated translations via Crowdin Fix org team endpoint (go-gitea#27721) Improve diff tree spacing (go-gitea#27714) refactor: make db iterate context aware (go-gitea#27710) [FIX] resolve confusing colors in languages stats by insert a gap (go-gitea#27704) Fix sticky diff header background (go-gitea#27697) Replace -1 with GhostUserID (go-gitea#27703) Clean some functions about project issue (go-gitea#27705)
As title