mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 04:25:55 +01:00
fix: regression caused by d3b3720915
This commit is contained in:
@@ -18,6 +18,7 @@ module.exports = function (Posts) {
|
||||
const content = data.content.toString();
|
||||
const timestamp = data.timestamp || Date.now();
|
||||
const isMain = data.isMain || false;
|
||||
let hasAttachment = false;
|
||||
|
||||
if (!uid && parseInt(uid, 10) !== 0) {
|
||||
throw new Error('[[error:invalid-uid]]');
|
||||
@@ -46,7 +47,6 @@ module.exports = function (Posts) {
|
||||
if (_activitypub.audience) {
|
||||
postData.audience = _activitypub.audience;
|
||||
}
|
||||
}
|
||||
|
||||
// Rewrite emoji references to inline image assets
|
||||
if (_activitypub && _activitypub.tag && Array.isArray(_activitypub.tag)) {
|
||||
@@ -65,14 +65,15 @@ module.exports = function (Posts) {
|
||||
});
|
||||
}
|
||||
|
||||
hasAttachment = _activitypub && _activitypub.attachment && _activitypub.attachment.length;
|
||||
}
|
||||
|
||||
({ post: postData } = await plugins.hooks.fire('filter:post.create', { post: postData, data: data }));
|
||||
await db.setObject(`post:${postData.pid}`, postData);
|
||||
|
||||
const topicData = await topics.getTopicFields(tid, ['cid', 'pinned']);
|
||||
postData.cid = topicData.cid;
|
||||
|
||||
const hasAttachment = _activitypub && _activitypub.attachment && _activitypub.attachment.length;
|
||||
|
||||
await Promise.all([
|
||||
db.sortedSetAdd('posts:pid', timestamp, postData.pid),
|
||||
utils.isNumber(pid) ? db.incrObjectField('global', 'postCount') : null,
|
||||
|
||||
Reference in New Issue
Block a user