Merge branch 'develop' into activitypub

This commit is contained in:
Barış Soner Uşaklı
2024-06-15 13:45:43 -04:00
3 changed files with 21 additions and 24 deletions

View File

@@ -2,24 +2,24 @@
"you-are-on": "You are on <strong>%1:%2</strong>",
"ip": "IP <strong>%1</strong>",
"nodes-responded": "%1 nodes ตอบสนองแล้วภายใน %2ms!",
"host": "host",
"host": "โฮสต์",
"primary": "primary / jobs",
"pid": "pid",
"nodejs": "nodejs",
"online": "online",
"git": "git",
"process-memory": "process memory",
"system-memory": "system memory",
"used-memory-process": "Used memory by process",
"used-memory-os": "Used system memory",
"total-memory-os": "Total system memory",
"load": "system load",
"cpu-usage": "cpu usage",
"process-memory": "หน่วยความจำโปรเซส",
"system-memory": "หน่วยความจำระบบ",
"used-memory-process": "หน่วยความจำที่ใช้โดยโปรเซส",
"used-memory-os": "หน่วยความจำระบบที่ใช้",
"total-memory-os": "หน่วยความจำระบบทั้งหมด",
"load": "โหลดของระบบ",
"cpu-usage": "การใช้งาน CPU",
"uptime": "ระยะเวลาการทำงาน",
"registered": "ลงทะเบียนแล้ว",
"sockets": "Sockets",
"connection-count": "Connection Count",
"sockets": "ซ็อกเก็ต",
"connection-count": "จำนวนการเชื่อมต่อ",
"guests": "ผู้เยี่ยมเยียน",
"info": "ข้อมูล"

View File

@@ -31,15 +31,17 @@ topicsController.get = async function getTopic(req, res, next) {
return next();
}
let postIndex = parseInt(req.params.post_index, 10) || 1;
const topicData = await topics.getTopicData(tid);
if (!topicData) {
return next();
}
const [
userPrivileges,
settings,
topicData,
rssToken,
] = await Promise.all([
privileges.topics.get(tid, req.uid),
user.getSettings(req.uid),
topics.getTopicData(tid),
user.auth.getFeedToken(req.uid),
]);
@@ -47,7 +49,6 @@ topicsController.get = async function getTopic(req, res, next) {
const pageCount = Math.max(1, Math.ceil((topicData && topicData.postcount) / settings.postsPerPage));
const invalidPagination = (settings.usePagination && (currentPage < 1 || currentPage > pageCount));
if (
!topicData ||
userPrivileges.disabled ||
invalidPagination ||
(topicData.scheduled && !userPrivileges.view_scheduled)
@@ -385,16 +386,14 @@ topicsController.pagination = async function (req, res, next) {
if (!utils.isNumber(tid)) {
return next();
}
const [userPrivileges, settings, topic] = await Promise.all([
privileges.topics.get(tid, req.uid),
user.getSettings(req.uid),
topics.getTopicData(tid),
]);
const topic = await topics.getTopicData(tid);
if (!topic) {
return next();
}
const [userPrivileges, settings] = await Promise.all([
privileges.topics.get(tid, req.uid),
user.getSettings(req.uid),
]);
if (!userPrivileges.read || !privileges.topics.canViewDeletedScheduled(topic, userPrivileges)) {
return helpers.notAllowed(req, res);

View File

@@ -116,10 +116,8 @@ function renderTimeago(event) {
}
Events.get = async (tid, uid, reverse = false) => {
const topics = require('.');
if (!await topics.exists(tid)) {
throw new Error('[[error:no-topic]]');
if (!tid) {
return [];
}
let eventIds = await db.getSortedSetRangeWithScores(`topic:${tid}:events`, 0, -1);