From 3bbf240d75c100bf97f380b5be567d157051d82a Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 28 Jul 2025 20:35:51 +0300 Subject: [PATCH] feat(log action): Show `attachment updated` action --- posting.php | 9 +++++++++ src/Legacy/Attach.php | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/posting.php b/posting.php index b75e17091..ddae2287d 100644 --- a/posting.php +++ b/posting.php @@ -368,6 +368,15 @@ if (($delete || $mode == 'delete') && !$confirm) { if (!$error_msg) { \TorrentPier\Legacy\Post::user_notification($mode, $post_data, $post_info['topic_title'], $forum_id, $topic_id, $notify_user); + + if (defined('ATTACHMENT_UPDATED')) { + global $log_action; + $log_action->mod('mod_topic_attach_updated', [ + 'forum_id' => $forum_id, + 'topic_id' => $topic_id, + 'topic_title' => $post_info['topic_title'], + ]); + } } if ($mode == 'newtopic' || $mode == 'reply') { diff --git a/src/Legacy/Attach.php b/src/Legacy/Attach.php index cd9ca32d2..213b254d6 100644 --- a/src/Legacy/Attach.php +++ b/src/Legacy/Attach.php @@ -479,14 +479,14 @@ class Attach unlink_attach($row['physical_filename'], MODE_THUMBNAIL); } - // todo: log action - torrent updated - //bt if ($this->attachment_extension_list[$actual_element] === TORRENT_EXT && $attachments[$actual_element]['tracker_status']) { Torrent::tracker_unregister($attachment_id); } //bt end + \define('ATTACHMENT_UPDATED', true); + // Make sure it is displayed $this->attachment_list[$actual_element] = $this->attach_filename; $this->attachment_comment_list[$actual_element] = $comment;