From e0af45e23b14630cc83d5bcc8e362793686fce7f Mon Sep 17 00:00:00 2001 From: Jay Bhensdadia Date: Sun, 5 May 2024 14:55:57 +0530 Subject: [PATCH] Fix: Prevent archiving of pinned threads in 'questions' forum --- .../tjbot/features/help/HelpThreadAutoArchiver.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadAutoArchiver.java b/application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadAutoArchiver.java index 1dd6053562..826b290565 100644 --- a/application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadAutoArchiver.java +++ b/application/src/main/java/org/togetherjava/tjbot/features/help/HelpThreadAutoArchiver.java @@ -79,6 +79,9 @@ private Instant computeArchiveAfterMoment() { } private void autoArchiveForThread(ThreadChannel threadChannel, Instant archiveAfterMoment) { + // if threadChannel is pinned then do not archive it! + if (threadChannel.isPinned()) + return; if (shouldBeArchived(threadChannel, archiveAfterMoment)) { logger.debug("Auto archiving help thread {}", threadChannel.getId());