mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: fallbacks for if preferredUsername is not set
This commit is contained in:
@@ -10,6 +10,7 @@ const categories = require('../categories');
|
|||||||
const posts = require('../posts');
|
const posts = require('../posts');
|
||||||
const topics = require('../topics');
|
const topics = require('../topics');
|
||||||
const plugins = require('../plugins');
|
const plugins = require('../plugins');
|
||||||
|
const slugify = require('../slugify');
|
||||||
const utils = require('../utils');
|
const utils = require('../utils');
|
||||||
|
|
||||||
const activitypub = module.parent.exports;
|
const activitypub = module.parent.exports;
|
||||||
@@ -23,11 +24,12 @@ Mocks.profile = async (actors) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const uid = actor.id;
|
const uid = actor.id;
|
||||||
const {
|
let {
|
||||||
preferredUsername, published, icon, image,
|
preferredUsername, published, icon, image,
|
||||||
name, summary, followerCount, followingCount,
|
name, summary, followerCount, followingCount,
|
||||||
postcount, inbox, endpoints,
|
postcount, inbox, endpoints,
|
||||||
} = actor;
|
} = actor;
|
||||||
|
preferredUsername = preferredUsername || slugify(name);
|
||||||
const { hostname } = new URL(actor.id);
|
const { hostname } = new URL(actor.id);
|
||||||
|
|
||||||
let picture;
|
let picture;
|
||||||
|
|||||||
Reference in New Issue
Block a user