use Friendica\Protocol\Activity;
use Friendica\Protocol\Delivery;
use Friendica\Security\PermissionSet\Repository\PermissionSet;
+use Friendica\Util\DateTimeFormat;
// Post-update script of PR 5751
function update_1298()
if (!DBA::e('UPDATE `user` u
JOIN `profile` p
ON p.`uid` = u.`uid`
- SET u.`username` = p.`name`')) {
+ SET u.`username` = p.`name`
+ WHERE p.`name` != ""')) {
return Update::FAILED;
}
return Update::SUCCESS;
}
+
+function update_1531()
+{
+ $threads = Post::selectThread(Item::DELIVER_FIELDLIST, ["`uid` = ? AND `created` > ?", 0, DateTimeFormat::utc('now - ' . DI::config()->get('channel', 'engagement_hours') . ' hour')]);
+ while ($post = Post::fetch($threads)) {
+ $post['gravity'] = Item::GRAVITY_COMMENT;
+ Post\Engagement::storeFromItem($post);
+ }
+ DBA::close($threads);
+
+ return Update::SUCCESS;
+}
\ No newline at end of file