New support: fix missing user data
This commit is contained in:
parent
b7f70e98e0
commit
9692659a05
1 changed files with 15 additions and 1 deletions
|
@ -2989,9 +2989,23 @@ Example
|
|||
});
|
||||
});
|
||||
|
||||
const getMyData = () => {
|
||||
let metadataMgr = common.getMetadataMgr();
|
||||
let priv = metadataMgr.getPrivateData();
|
||||
let user = metadataMgr.getUserData();
|
||||
return {
|
||||
name: user.name,
|
||||
edPublic: priv.edPublic,
|
||||
curvePublic: user.curvePublic,
|
||||
mailbox: user.notifications,
|
||||
profile: user.profile
|
||||
// XXX add avatar?
|
||||
};
|
||||
};
|
||||
const getContactData = (curve) => {
|
||||
if (!curve) { return getMyData(); }
|
||||
let friends = common.getFriends(true);
|
||||
let f = friends[curve || 'me'];
|
||||
let f = friends[curve];
|
||||
return {
|
||||
name: f.displayName,
|
||||
edPublic: f.edPublic,
|
||||
|
|
Loading…
Reference in a new issue