Merge branch 'develop' into activitypub

This commit is contained in:
Barış Soner Uşaklı
2024-10-18 09:17:53 -04:00
19 changed files with 193 additions and 52 deletions

View File

@@ -170,8 +170,7 @@ module.exports = function (Topics) {
Topics.reply = async function (data) {
data = await plugins.hooks.fire('filter:topic.reply', data);
const { tid } = data;
const { uid } = data;
const { tid, uid } = data;
const [topicData, isAdmin] = await Promise.all([
Topics.getTopicData(tid),

View File

@@ -199,7 +199,7 @@ module.exports = function (Topics) {
}
const cids = params.cid || await getWatchedTrackedCids(params.uid);
const keys = cids.map(cid => `cid:${cid}:tids:lastposttime`);
return await db.getSortedSetRevRangeByScoreWithScores(keys, 0, -1, '+inf', params.cutoff);
return await db.getSortedSetRevRangeByScoreWithScores(keys, 0, 200, '+inf', params.cutoff);
}
async function getWatchedTrackedCids(uid) {
@@ -218,7 +218,7 @@ module.exports = function (Topics) {
params.cid.map(cid => `cid:${cid}:tids:lastposttime`) :
'topics:recent';
const recentTopicData = await db.getSortedSetRevRangeByScoreWithScores(keys, 0, -1, '+inf', params.cutoff);
const recentTopicData = await db.getSortedSetRevRangeByScoreWithScores(keys, 0, 200, '+inf', params.cutoff);
const isFollowed = await db.isSortedSetMembers(`uid:${params.uid}:followed_tids`, recentTopicData.map(t => t.tid));
return recentTopicData.filter((t, i) => isFollowed[i]);
}

View File

@@ -210,7 +210,7 @@
{{{ end }}}
</button>
<button class="btn btn-ghost btn-sm d-flex gap-2 align-items-center">
<button class="btn btn-ghost btn-sm d-flex gap-2 align-items-center purge">
<i class="fa fa-fw fa-trash text-danger"></i> [[admin/manage/categories:purge]]
</button>