mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Support choose email when creating a commit via web UI (#33432)
Initial PR for #24469
This commit is contained in:
@@ -542,3 +542,13 @@ func IsEmailDomainAllowed(email string) bool {
|
||||
|
||||
return validation.IsEmailDomainListed(setting.Service.EmailDomainAllowList, email)
|
||||
}
|
||||
|
||||
func GetActivatedEmailAddresses(ctx context.Context, uid int64) ([]string, error) {
|
||||
emails := make([]string, 0, 2)
|
||||
if err := db.GetEngine(ctx).Table("email_address").Select("email").
|
||||
Where("uid=? AND is_activated=?", uid, true).Asc("id").
|
||||
Find(&emails); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return emails, nil
|
||||
}
|
||||
|
@@ -214,7 +214,7 @@ func (u *User) GetPlaceholderEmail() string {
|
||||
return fmt.Sprintf("%s@%s", u.LowerName, setting.Service.NoReplyAddress)
|
||||
}
|
||||
|
||||
// GetEmail returns an noreply email, if the user has set to keep his
|
||||
// GetEmail returns a noreply email, if the user has set to keep his
|
||||
// email address private, otherwise the primary email address.
|
||||
func (u *User) GetEmail() string {
|
||||
if u.KeepEmailPrivate {
|
||||
|
Reference in New Issue
Block a user