Do not import as pack from AP renderer (#4048)
* Do not import as pack from AP renderer * rename
This commit is contained in:
parent
e220ef3e75
commit
b8a7468c4a
21 changed files with 55 additions and 55 deletions
|
@ -7,7 +7,7 @@ import { deliver } from '../../queue';
|
|||
import renderNote from '../../remote/activitypub/renderer/note';
|
||||
import renderCreate from '../../remote/activitypub/renderer/create';
|
||||
import renderAnnounce from '../../remote/activitypub/renderer/announce';
|
||||
import packAp from '../../remote/activitypub/renderer';
|
||||
import { renderActivity } from '../../remote/activitypub/renderer';
|
||||
import DriveFile, { IDriveFile } from '../../models/drive-file';
|
||||
import notify from '../../notify';
|
||||
import NoteWatching from '../../models/note-watching';
|
||||
|
@ -283,7 +283,7 @@ export default async (user: IUser, data: Option, silent = false) => new Promise<
|
|||
|
||||
createMentionedEvents(mentionedUsers, note, nm);
|
||||
|
||||
const noteActivity = await renderActivity(data, note);
|
||||
const noteActivity = await renderNoteOrRenoteActivity(data, note);
|
||||
|
||||
if (isLocalUser(user)) {
|
||||
deliverNoteToMentionedRemoteUsers(mentionedUsers, user, noteActivity);
|
||||
|
@ -341,14 +341,14 @@ export default async (user: IUser, data: Option, silent = false) => new Promise<
|
|||
index(note);
|
||||
});
|
||||
|
||||
async function renderActivity(data: Option, note: INote) {
|
||||
async function renderNoteOrRenoteActivity(data: Option, note: INote) {
|
||||
if (data.localOnly) return null;
|
||||
|
||||
const content = data.renote && data.text == null && data.poll == null && (data.files == null || data.files.length == 0)
|
||||
? renderAnnounce(data.renote.uri ? data.renote.uri : `${config.url}/notes/${data.renote._id}`, note)
|
||||
: renderCreate(await renderNote(note, false), note);
|
||||
|
||||
return packAp(content);
|
||||
return renderActivity(content);
|
||||
}
|
||||
|
||||
function incRenoteCount(renote: INote) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue