mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-12 02:23:12 +01:00
revert: use of vanity domains, needs rethinking. Originally added in 709a02d97a
This commit is contained in:
@@ -47,7 +47,6 @@ Actors.assert = async (ids, options = {}) => {
|
||||
ids = ids.filter(id => !utils.isNumber(id));
|
||||
|
||||
// Translate webfinger handles to uris
|
||||
const hostMap = new Map();
|
||||
ids = (await Promise.all(ids.map(async (id) => {
|
||||
const originalId = id;
|
||||
if (activitypub.helpers.isWebfinger(id)) {
|
||||
@@ -57,7 +56,6 @@ Actors.assert = async (ids, options = {}) => {
|
||||
}
|
||||
|
||||
({ actorUri: id } = await activitypub.helpers.query(id));
|
||||
hostMap.set(id, host);
|
||||
}
|
||||
// ensure the final id is a valid URI
|
||||
if (!id || !activitypub.helpers.isUri(id)) {
|
||||
@@ -163,7 +161,7 @@ Actors.assert = async (ids, options = {}) => {
|
||||
actors = actors.filter(Boolean); // remove unresolvable actors
|
||||
|
||||
// Build userData object for storage
|
||||
const profiles = (await activitypub.mocks.profile(actors, hostMap)).filter(Boolean);
|
||||
const profiles = (await activitypub.mocks.profile(actors)).filter(Boolean);
|
||||
const now = Date.now();
|
||||
|
||||
const bulkSet = profiles.reduce((memo, profile) => {
|
||||
|
||||
@@ -129,7 +129,7 @@ Mocks._normalize = async (object) => {
|
||||
};
|
||||
};
|
||||
|
||||
Mocks.profile = async (actors, hostMap) => {
|
||||
Mocks.profile = async (actors) => {
|
||||
// Should only ever be called by activitypub.actors.assert
|
||||
const profiles = await Promise.all(actors.map(async (actor) => {
|
||||
if (!actor) {
|
||||
@@ -137,7 +137,7 @@ Mocks.profile = async (actors, hostMap) => {
|
||||
}
|
||||
|
||||
const uid = actor.id;
|
||||
let hostname = hostMap.get(uid);
|
||||
let hostname;
|
||||
let {
|
||||
url, preferredUsername, published, icon, image,
|
||||
name, summary, followers, inbox, endpoints, tag,
|
||||
@@ -145,12 +145,10 @@ Mocks.profile = async (actors, hostMap) => {
|
||||
preferredUsername = slugify(preferredUsername || name);
|
||||
const { followers: followerCount, following: followingCount } = await activitypub.actors.getLocalFollowCounts(uid);
|
||||
|
||||
if (!hostname) { // if not available via webfinger, infer from id
|
||||
try {
|
||||
({ hostname } = new URL(actor.id));
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
({ hostname } = new URL(actor.id));
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let picture;
|
||||
|
||||
Reference in New Issue
Block a user