aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/models/lazy_identity.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-02-25 21:35:57 +0100
committerMichael Muré <batolettre@gmail.com>2020-02-25 21:35:57 +0100
commit893de4f5c0e852fac9a73e0c0243bc038af75f17 (patch)
tree6129d0a6e2efbfa81b26534ee5aeb65ba1261bfe /graphql/models/lazy_identity.go
parent68acfa519ab6656648d1e976db2a4190bbeb5f44 (diff)
downloadgit-bug-893de4f5c0e852fac9a73e0c0243bc038af75f17.tar.gz
identity: bring back the login to hold that info from bridges (purely informational)
Diffstat (limited to 'graphql/models/lazy_identity.go')
-rw-r--r--graphql/models/lazy_identity.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/graphql/models/lazy_identity.go b/graphql/models/lazy_identity.go
index bbd36be3..344bb5f0 100644
--- a/graphql/models/lazy_identity.go
+++ b/graphql/models/lazy_identity.go
@@ -18,6 +18,7 @@ type IdentityWrapper interface {
Id() entity.Id
Name() string
Email() (string, error)
+ Login() (string, error)
AvatarUrl() (string, error)
Keys() ([]*identity.Key, error)
ValidKeysAtTime(time lamport.Time) ([]*identity.Key, error)
@@ -76,6 +77,14 @@ func (li *lazyIdentity) Email() (string, error) {
return id.Email(), nil
}
+func (li *lazyIdentity) Login() (string, error) {
+ id, err := li.load()
+ if err != nil {
+ return "", err
+ }
+ return id.Login(), nil
+}
+
func (li *lazyIdentity) AvatarUrl() (string, error) {
id, err := li.load()
if err != nil {
@@ -142,6 +151,10 @@ func (l loadedIdentity) Email() (string, error) {
return l.Interface.Email(), nil
}
+func (l loadedIdentity) Login() (string, error) {
+ return l.Interface.Login(), nil
+}
+
func (l loadedIdentity) AvatarUrl() (string, error) {
return l.Interface.AvatarUrl(), nil
}