mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-16 11:37:37 +01:00
Merge branch 'master' into develop
This commit is contained in:
@@ -294,9 +294,13 @@ inbox.announce = async (req) => {
|
|||||||
const { id: localId } = await activitypub.helpers.resolveLocalId(id);
|
const { id: localId } = await activitypub.helpers.resolveLocalId(id);
|
||||||
const exists = await posts.exists(localId || id);
|
const exists = await posts.exists(localId || id);
|
||||||
if (exists) {
|
if (exists) {
|
||||||
const result = await posts.upvote(localId || id, object.actor);
|
try {
|
||||||
if (localId) {
|
const result = await posts.upvote(localId || id, object.actor);
|
||||||
socketHelpers.upvote(result, 'notifications:upvoted-your-post-in');
|
if (localId) {
|
||||||
|
socketHelpers.upvote(result, 'notifications:upvoted-your-post-in');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// vote denied due to local limitations (frequency, privilege, etc.); noop.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -188,13 +188,16 @@ module.exports = function (Posts) {
|
|||||||
data: data,
|
data: data,
|
||||||
};
|
};
|
||||||
payload = await plugins.hooks.fire('filter:post-queue.save', payload);
|
payload = await plugins.hooks.fire('filter:post-queue.save', payload);
|
||||||
payload.data = JSON.stringify(data);
|
|
||||||
|
|
||||||
await db.sortedSetAdd('post:queue', now, id);
|
await db.sortedSetAdd('post:queue', now, id);
|
||||||
await db.setObject(`post:queue:${id}`, payload);
|
await db.setObject(`post:queue:${id}`, {
|
||||||
|
...payload,
|
||||||
|
data: JSON.stringify(payload.data),
|
||||||
|
});
|
||||||
await user.setUserField(data.uid, 'lastqueuetime', now);
|
await user.setUserField(data.uid, 'lastqueuetime', now);
|
||||||
cache.del('post-queue');
|
cache.del('post-queue');
|
||||||
|
|
||||||
|
await plugins.hooks.fire('action:post-queue.save', payload);
|
||||||
const cid = await getCid(type, data);
|
const cid = await getCid(type, data);
|
||||||
const uids = await getNotificationUids(cid);
|
const uids = await getNotificationUids(cid);
|
||||||
const bodyLong = await parseBodyLong(cid, type, data);
|
const bodyLong = await parseBodyLong(cid, type, data);
|
||||||
|
|||||||
Reference in New Issue
Block a user