Like on uid=0 does work now

This commit is contained in:
Michael 2017-12-27 22:21:40 +00:00
parent 9acc2ffc24
commit 0bcbe6034e
2 changed files with 3 additions and 9 deletions

View File

@ -151,7 +151,7 @@ function do_like($item_id, $verb) {
AND (`parent` = '%s' OR `parent-uri` = '%s' OR `thr-parent` = '%s') AND (`parent` = '%s' OR `parent-uri` = '%s' OR `thr-parent` = '%s')
LIMIT 1", LIMIT 1",
intval($author_contact['id']), intval($author_contact['id']),
intval($uid), intval($item['uid']),
dbesc($item_id), dbesc($item_id), dbesc($item['uri']) dbesc($item_id), dbesc($item_id), dbesc($item['uri'])
); );
@ -210,8 +210,8 @@ EOT;
$new_item = array( $new_item = array(
'guid' => get_guid(32), 'guid' => get_guid(32),
'uri' => item_new_uri($a->get_hostname(), $uid), 'uri' => item_new_uri($a->get_hostname(), $item['uid']),
'uid' => $uid, 'uid' => $item['uid'],
'contact-id' => $item_contact_id, 'contact-id' => $item_contact_id,
'type' => 'activity', 'type' => 'activity',
'wall' => $item['wall'], 'wall' => $item['wall'],

View File

@ -154,12 +154,10 @@ class Notifier {
FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d AND visible AND NOT moderated ORDER BY `id` ASC", FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d AND visible AND NOT moderated ORDER BY `id` ASC",
intval($parent_id) intval($parent_id)
); );
logger('Blubb: a-'.$item_id);
if (!count($items)) { if (!count($items)) {
return; return;
} }
logger('Blubb: b-'.$item_id);
// avoid race condition with deleting entries // avoid race condition with deleting entries
if ($items[0]['deleted']) { if ($items[0]['deleted']) {
@ -173,13 +171,11 @@ logger('Blubb: b-'.$item_id);
$top_level = true; $top_level = true;
} }
} }
logger('Blubb: 0-'.$item_id.' - '.$uid);
$owner = User::getOwnerDataById($uid); $owner = User::getOwnerDataById($uid);
if (!$owner) { if (!$owner) {
return; return;
} }
logger('Blubb: 1-'.$item_id);
$walltowall = ($top_level && ($owner['id'] != $items[0]['contact-id']) ? true : false); $walltowall = ($top_level && ($owner['id'] != $items[0]['contact-id']) ? true : false);
@ -197,14 +193,12 @@ logger('Blubb: 1-'.$item_id);
// fill this in with a single salmon slap if applicable // fill this in with a single salmon slap if applicable
$slap = ''; $slap = '';
logger('Blubb: 2-'.$item_id);
if (! ($mail || $fsuggest || $relocate)) { if (! ($mail || $fsuggest || $relocate)) {
$slap = OStatus::salmon($target_item, $owner); $slap = OStatus::salmon($target_item, $owner);
$parent = $items[0]; $parent = $items[0];
logger('Blubb: 3-'.$item_id);
$thr_parent = q("SELECT `network`, `author-link`, `owner-link` FROM `item` WHERE `uri` = '%s' AND `uid` = %d", $thr_parent = q("SELECT `network`, `author-link`, `owner-link` FROM `item` WHERE `uri` = '%s' AND `uid` = %d",
dbesc($target_item["thr-parent"]), intval($target_item["uid"])); dbesc($target_item["thr-parent"]), intval($target_item["uid"]));