mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-16 21:40:23 +01:00
refactor: :trollface:
This commit is contained in:
@@ -122,22 +122,23 @@ SocketPosts.reject = async function (socket, data) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
async function logQueueEvent(socket, result, type) {
|
async function logQueueEvent(socket, result, type) {
|
||||||
await events.log({
|
const eventData = {
|
||||||
type: `post-queue-${result.type}-${type}`,
|
type: `post-queue-${result.type}-${type}`,
|
||||||
uid: socket.uid,
|
uid: socket.uid,
|
||||||
ip: socket.ip,
|
ip: socket.ip,
|
||||||
content: result.data.content,
|
content: result.data.content,
|
||||||
targetUid: result.uid,
|
targetUid: result.uid,
|
||||||
...(result.type === 'topic' ?
|
};
|
||||||
{
|
if (result.type === 'topic') {
|
||||||
cid: result.data.cid,
|
eventData.cid = result.data.cid;
|
||||||
title: result.data.title,
|
eventData.title = result.data.title;
|
||||||
} :
|
} else {
|
||||||
{
|
eventData.tid = result.data.tid;
|
||||||
tid: result.data.tid,
|
}
|
||||||
}),
|
if (result.pid) {
|
||||||
...(result.pid ? { pid: result.pid } : {}),
|
eventData.pid = result.pid;
|
||||||
});
|
}
|
||||||
|
await events.log(eventData);
|
||||||
}
|
}
|
||||||
|
|
||||||
SocketPosts.notify = async function (socket, data) {
|
SocketPosts.notify = async function (socket, data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user