#2246 fully support of webhooks for pull request

This commit is contained in:
Unknwon 2016-08-14 03:32:24 -07:00
parent 0f33b04c87
commit 3f7f4852ef
30 changed files with 795 additions and 270 deletions

View file

@ -25,6 +25,7 @@ import (
"github.com/nfnt/resize"
"github.com/gogits/git-module"
api "github.com/gogits/go-gogs-client"
"github.com/gogits/gogs/modules/avatar"
"github.com/gogits/gogs/modules/base"
@ -130,6 +131,16 @@ func (u *User) AfterSet(colName string, _ xorm.Cell) {
}
}
func (u *User) APIFormat() *api.User {
return &api.User{
ID: u.ID,
UserName: u.Name,
FullName: u.FullName,
Email: u.Email,
AvatarUrl: u.AvatarLink(),
}
}
// returns true if user login type is LOGIN_PLAIN.
func (u *User) IsLocal() bool {
return u.LoginType <= LOGIN_PLAIN
@ -468,12 +479,12 @@ func GetUserSalt() string {
return base.GetRandomString(10)
}
// NewFakeUser creates and returns a fake user for someone has deleted his/her account.
func NewFakeUser() *User {
// NewGhostUser creates and returns a fake user for someone has deleted his/her account.
func NewGhostUser() *User {
return &User{
ID: -1,
Name: "Someone",
LowerName: "someone",
Name: "Ghost",
LowerName: "ghost",
}
}