diff options
author | zotlabs <mike@macgirvin.com> | 2018-03-21 22:52:24 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-03-21 22:52:24 -0700 |
commit | 1f128e84fb8f407c6bd678b3b2bb25605884cfc5 (patch) | |
tree | 1d0b2a700b7eccb57226d6e9620689d9e3754c83 /Zotlabs | |
parent | 1514b0f4e5c053df60b8873b5411c70be727d227 (diff) | |
download | volse-hubzilla-1f128e84fb8f407c6bd678b3b2bb25605884cfc5.tar.gz volse-hubzilla-1f128e84fb8f407c6bd678b3b2bb25605884cfc5.tar.bz2 volse-hubzilla-1f128e84fb8f407c6bd678b3b2bb25605884cfc5.zip |
Hubzilla issue #1006, fix anonymous comments bump thread before being approved.
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Moderate.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Zotlabs/Module/Moderate.php b/Zotlabs/Module/Moderate.php index cf1625a6b..b4709f3bd 100644 --- a/Zotlabs/Module/Moderate.php +++ b/Zotlabs/Module/Moderate.php @@ -52,6 +52,20 @@ class Moderate extends \Zotlabs\Web\Controller { intval(local_channel()), intval($post_id) ); + + // update the parent's commented timestamp + + $z = q("select max(created) as commented from item where parent_mid = '%s' and uid = %d and item_delayed = 0 ", + dbesc($r[0]['parent_mid']), + intval(local_channel()) + ); + + q("UPDATE item set commented = '%s', changed = '%s' WHERE id = %d", + dbesc(($z) ? $z[0]['commented'] : (datetime_convert())), + dbesc(datetime_convert()), + intval($r[0]['parent']) + ); + notice( t('Comment approved') . EOL); } elseif($action === 'drop') { |