X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Ftagger.php;h=af555790a53fda3a083758d36ca30d44187bce31;hb=b0bf4b435949e923caa5d6d52b12d364bf16ae82;hp=86a6ff69f302c3d97ea1b2100716a7e417e43e90;hpb=aa0b485f3dca72c5448076e913fa54d948cd7731;p=friendica.git diff --git a/mod/tagger.php b/mod/tagger.php index 86a6ff69f3..af555790a5 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -1,6 +1,6 @@ argc > 1) ? Strings::escapeTags(trim($a->argv[1])) : 0); + $item_id = ((DI::args()->getArgc() > 1) ? Strings::escapeTags(trim(DI::args()->getArgv()[1])) : 0); - Logger::log('tagger: tag ' . $term . ' item ' . $item_id); + Logger::notice('tagger: tag ' . $term . ' item ' . $item_id); - $item = Item::selectFirst([], ['id' => $item_id]); + $item = Post::selectFirst([], ['id' => $item_id]); if (!$item_id || !DBA::isResult($item)) { - Logger::log('tagger: no item ' . $item_id); + Logger::notice('tagger: no item ' . $item_id); return; } $owner_uid = $item['uid']; - $blocktags = 0; - - $r = q("select `blocktags` from user where uid = %d limit 1", - intval($owner_uid) - ); - if (DBA::isResult($r)) { - $blocktags = $r[0]['blocktags']; - } if (local_user() != $owner_uid) { return; } - $r = q("select * from contact where self = 1 and uid = %d limit 1", - intval(local_user()) - ); - if (DBA::isResult($r)) { - $contact = $r[0]; - } else { - Logger::log('tagger: no contact_id'); + $contact = Contact::selectFirst([], ['self' => true, 'uid' => local_user()]); + if (!DBA::isResult($contact)) { + Logger::notice('tagger: no contact_id'); return; } @@ -136,7 +126,7 @@ EOT; $arr['wall'] = $item['wall']; $arr['gravity'] = GRAVITY_COMMENT; $arr['parent'] = $item['id']; - $arr['parent-uri'] = $item['uri']; + $arr['thr-parent'] = $item['uri']; $arr['owner-name'] = $item['author-name']; $arr['owner-link'] = $item['author-link']; $arr['owner-avatar'] = $item['author-avatar']; @@ -175,7 +165,9 @@ EOT; Hook::callAll('post_local_end', $arr); - Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $post_id); + $post = Post::selectFirst(['uri-id', 'uid'], ['id' => $post_id]); + + Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $post['uri-id'], $post['uid']); exit(); }