summaryrefslogtreecommitdiffstats
path: root/models/gpg_key.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/gpg_key.go')
-rw-r--r--models/gpg_key.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/models/gpg_key.go b/models/gpg_key.go
index a62ed61966..357dc2b964 100644
--- a/models/gpg_key.go
+++ b/models/gpg_key.go
@@ -10,6 +10,7 @@ import (
"time"
"code.gitea.io/gitea/models/db"
+ user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/timeutil"
@@ -36,7 +37,7 @@ type GPGKey struct {
ExpiredUnix timeutil.TimeStamp
AddedUnix timeutil.TimeStamp
SubsKey []*GPGKey `xorm:"-"`
- Emails []*EmailAddress
+ Emails []*user_model.EmailAddress
Verified bool `xorm:"NOT NULL DEFAULT false"`
CanSign bool
CanEncryptComms bool
@@ -148,12 +149,12 @@ func parseGPGKey(ownerID int64, e *openpgp.Entity, verified bool) (*GPGKey, erro
}
// Check emails
- userEmails, err := GetEmailAddresses(ownerID)
+ userEmails, err := user_model.GetEmailAddresses(ownerID)
if err != nil {
return nil, err
}
- emails := make([]*EmailAddress, 0, len(e.Identities))
+ emails := make([]*user_model.EmailAddress, 0, len(e.Identities))
for _, ident := range e.Identities {
if ident.Revocation != nil {
continue
@@ -242,7 +243,7 @@ func DeleteGPGKey(doer *User, id int64) (err error) {
func checkKeyEmails(email string, keys ...*GPGKey) (bool, string) {
uid := int64(0)
- var userEmails []*EmailAddress
+ var userEmails []*user_model.EmailAddress
var user *User
for _, key := range keys {
for _, e := range key.Emails {
@@ -252,7 +253,7 @@ func checkKeyEmails(email string, keys ...*GPGKey) (bool, string) {
}
if key.Verified && key.OwnerID != 0 {
if uid != key.OwnerID {
- userEmails, _ = GetEmailAddresses(key.OwnerID)
+ userEmails, _ = user_model.GetEmailAddresses(key.OwnerID)
uid = key.OwnerID
user = &User{ID: uid}
_, _ = GetUser(user)