mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: do not include image or icon props if they are falsy values
This commit is contained in:
@@ -486,6 +486,7 @@ Mocks.actors.user = async (uid) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
...{
|
||||||
'@context': [
|
'@context': [
|
||||||
'https://www.w3.org/ns/activitystreams',
|
'https://www.w3.org/ns/activitystreams',
|
||||||
'https://w3id.org/security/v1',
|
'https://w3id.org/security/v1',
|
||||||
@@ -501,8 +502,6 @@ Mocks.actors.user = async (uid) => {
|
|||||||
name: username !== displayname ? fullname : username, // displayname is escaped, fullname is not
|
name: username !== displayname ? fullname : username, // displayname is escaped, fullname is not
|
||||||
preferredUsername: userslug,
|
preferredUsername: userslug,
|
||||||
summary: aboutmeParsed,
|
summary: aboutmeParsed,
|
||||||
icon: picture,
|
|
||||||
image: cover,
|
|
||||||
published: new Date(joindate).toISOString(),
|
published: new Date(joindate).toISOString(),
|
||||||
attachment,
|
attachment,
|
||||||
|
|
||||||
@@ -515,6 +514,9 @@ Mocks.actors.user = async (uid) => {
|
|||||||
endpoints: {
|
endpoints: {
|
||||||
sharedInbox: `${nconf.get('url')}/inbox`,
|
sharedInbox: `${nconf.get('url')}/inbox`,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
...(picture && { icon: picture }),
|
||||||
|
...(cover && { image: cover }),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user