From edd2fc38fc2d6f0ff7f344d11236190a44404f5d Mon Sep 17 00:00:00 2001 From: gasoved Date: Thu, 16 Feb 2023 04:38:51 +0300 Subject: [PATCH] fix: update main post timestamp when rescheduling --- src/topics/scheduled.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/topics/scheduled.js b/src/topics/scheduled.js index 3544e54945..a386de8869 100644 --- a/src/topics/scheduled.js +++ b/src/topics/scheduled.js @@ -60,6 +60,7 @@ Scheduled.pin = async function (tid, topicData) { }; Scheduled.reschedule = async function ({ cid, tid, timestamp, uid }) { + const mainPid = await topics.getTopicField(tid, 'mainPid'); await Promise.all([ db.sortedSetsAdd([ 'topics:scheduled', @@ -67,6 +68,7 @@ Scheduled.reschedule = async function ({ cid, tid, timestamp, uid }) { 'topics:tid', `cid:${cid}:uid:${uid}:tids`, ], timestamp, tid), + posts.setPostField(mainPid, 'timestamp', timestamp), shiftPostTimes(tid, timestamp), ]); return topics.updateLastPostTimeFromLastPid(tid);