Skip to content

Commit

Permalink
Stay on current page after checking messages/requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
thisismeonmounteverest committed Sep 16, 2024
1 parent 103c47a commit 4fbb425
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/Controller/Admin/CheckerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ private function handleMessages(Request $request, int $type): Response
$this->checkerModel->unmarkAsSpamByChecker($noSpamMessageIds);
$this->addFlash('notice', 'Set spam status');

if ($type === self::MESSAGES_BLOCK_WORDS_PROCESSED) {
return $this->redirectToRoute('admin_spam_messages_block_words');
}

return $this->redirectToRoute('admin_spam_messages');
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Model/ConversationModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,15 @@ public function getLastMessageInConversation(Message $probableParent): Message
{
// Check if there is already a newer message than the one used for the request
// as there might be a clash of replies
/** @var MessageRepository */
/** @var MessageRepository $messageRepository */
$messageRepository = $this->entityManager->getRepository(Message::class);
/** @var Message[] $messages */
$messages = $messageRepository->findBy(['subject' => $probableParent->getSubject()]);

return $messages[\count($messages) - 1];
}

public function markConversationAsRead(Member $member, array $thread)
public function markConversationAsRead(Member $member, array $thread): void
{
// Walk through the thread and mark all messages as read (for current member)
$em = $this->entityManager;
Expand Down

0 comments on commit 4fbb425

Please sign in to comment.