X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FTagUpdate.php;h=213c26ac0ad0e234d25c53c3ebd03aa587bba311;hb=1e0e1674f2aeef54c52790946cfd61a199cb2042;hp=93423ecb2a7fa5729398c0563ca8a0a0dd882401;hpb=a21f6135fcd8f0bfdb49de38a5ab4954d1784503;p=friendica.git diff --git a/src/Worker/TagUpdate.php b/src/Worker/TagUpdate.php index 93423ecb2a..213c26ac0a 100644 --- a/src/Worker/TagUpdate.php +++ b/src/Worker/TagUpdate.php @@ -1,10 +1,40 @@ true], ['otype' => TERM_OBJ_POST, 'guid' => $message['guid']]); + } else { + $global = (DBA::count('term', ['uid' => 0, 'otype' => TERM_OBJ_POST, 'guid' => $message['guid']]) > 0); + } + + $fields = ['guid' => $message['guid'], 'created' => $message['created'], + 'received' => $message['received'], 'global' => $global]; + DBA::update('term', $fields, ['otype' => TERM_OBJ_POST, 'oid' => $message['oid']]); + } + + DBA::close($messages); + + $messages = DBA::select('item', ['guid'], ['uid' => 0]); + + Logger::log('fetched messages: ' . DBA::numRows($messages)); + while ($message = DBA::fetch($messages)) { + DBA::update('item', ['global' => true], ['guid' => $message['guid']]); + } -class TagUpdate { - public static function execute() { - update_items(); + DBA::close($messages); } }