mirror of
https://github.com/friendica/friendica
synced 2024-12-23 18:00:17 +00:00
First steps to support public likes
This commit is contained in:
parent
2e022733f6
commit
fc0031f4ba
1 changed files with 14 additions and 10 deletions
|
@ -80,12 +80,13 @@ function do_like($item_id, $verb) {
|
||||||
|
|
||||||
$item = $items[0];
|
$item = $items[0];
|
||||||
|
|
||||||
if (!can_write_wall($a, $item['uid'])) {
|
if (!can_write_wall($a, $item['uid']) && ($item['uid'] != 0)) {
|
||||||
logger('like: unable to write on wall ' . $item['uid']);
|
logger('like: unable to write on wall ' . $item['uid']);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieves the local post owner
|
// Retrieves the local post owner
|
||||||
|
if ($item['uid'] != 0) {
|
||||||
$owners = q("SELECT `contact`.* FROM `contact`
|
$owners = q("SELECT `contact`.* FROM `contact`
|
||||||
WHERE `contact`.`self`
|
WHERE `contact`.`self`
|
||||||
AND `contact`.`uid` = %d",
|
AND `contact`.`uid` = %d",
|
||||||
|
@ -97,6 +98,9 @@ function do_like($item_id, $verb) {
|
||||||
logger('like: unknown owner ' . $item['uid']);
|
logger('like: unknown owner ' . $item['uid']);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$owner_self_contact = ['uid' => 0, 'nick' => 'feed-item'];
|
||||||
|
}
|
||||||
|
|
||||||
// Retrieve the current logged in user's public contact
|
// Retrieve the current logged in user's public contact
|
||||||
$author_id = public_contact();
|
$author_id = public_contact();
|
||||||
|
|
Loading…
Reference in a new issue