X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FTagUpdate.php;h=3dac20b6cf4b9e71a99df1a7f8dfd99fa35ab096;hb=cbfc3d0c28e0b55c3ccf1ddfd321798a8c2532e8;hp=93423ecb2a7fa5729398c0563ca8a0a0dd882401;hpb=8a0bec00c4ef9ebf8c122b64190e231bb7a43294;p=friendica.git diff --git a/src/Worker/TagUpdate.php b/src/Worker/TagUpdate.php index 93423ecb2a..3dac20b6cf 100644 --- a/src/Worker/TagUpdate.php +++ b/src/Worker/TagUpdate.php @@ -1,10 +1,39 @@ 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('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); } }