mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 00:15:46 +01:00
feat: scheduled topics (#9399)
* feat: scheduled topics * refactor: linting fixes * fix: tests * fix(test): race condition * fix: make a single request
This commit is contained in:
@@ -13,7 +13,7 @@ const events = require('../events');
|
||||
exports.setDefaultPostData = function (reqOrSocket, data) {
|
||||
data.uid = reqOrSocket.uid;
|
||||
data.req = exports.buildReqObject(reqOrSocket, { ...data });
|
||||
data.timestamp = Date.now();
|
||||
data.timestamp = parseInt(data.timestamp, 10) || Date.now();
|
||||
data.fromQueue = false;
|
||||
};
|
||||
|
||||
|
||||
@@ -20,7 +20,12 @@ topicsAPI.get = async function (caller, data) {
|
||||
privileges.topics.get(data.tid, caller.uid),
|
||||
topics.getTopicData(data.tid),
|
||||
]);
|
||||
if (!topic || !userPrivileges.read || !userPrivileges['topics:read'] || (topic.deleted && !userPrivileges.view_deleted)) {
|
||||
if (
|
||||
!topic ||
|
||||
!userPrivileges.read ||
|
||||
!userPrivileges['topics:read'] ||
|
||||
!privileges.topics.canViewDeletedScheduled(topic, userPrivileges)
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user