Import/Export backend prep

This commit is contained in:
Michal Horejsek
2020-05-14 15:22:29 +02:00
parent 9d65192ad7
commit b598779c0f
92 changed files with 6983 additions and 188 deletions

View File

@ -359,14 +359,17 @@ func (u *User) GetAddressID(address string) (id string, err error) {
u.lock.RLock()
defer u.lock.RUnlock()
address = strings.ToLower(address)
if u.store == nil {
err = errors.New("store is not initialised")
return
if u.store != nil {
address = strings.ToLower(address)
return u.store.GetAddressID(address)
}
return u.store.GetAddressID(address)
addresses := u.client().Addresses()
pmapiAddress := addresses.ByEmail(address)
if pmapiAddress != nil {
return pmapiAddress.ID, nil
}
return "", errors.New("address not found")
}
// GetBridgePassword returns bridge password. This is not a password of the PM