mirror of
https://github.com/friendica/friendica
synced 2024-12-23 13:20:21 +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,22 +80,26 @@ function do_like($item_id, $verb) {
|
|||
|
||||
$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']);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Retrieves the local post owner
|
||||
$owners = q("SELECT `contact`.* FROM `contact`
|
||||
WHERE `contact`.`self`
|
||||
AND `contact`.`uid` = %d",
|
||||
intval($item['uid'])
|
||||
);
|
||||
if (DBM::is_result($owners)) {
|
||||
$owner_self_contact = $owners[0];
|
||||
if ($item['uid'] != 0) {
|
||||
$owners = q("SELECT `contact`.* FROM `contact`
|
||||
WHERE `contact`.`self`
|
||||
AND `contact`.`uid` = %d",
|
||||
intval($item['uid'])
|
||||
);
|
||||
if (DBM::is_result($owners)) {
|
||||
$owner_self_contact = $owners[0];
|
||||
} else {
|
||||
logger('like: unknown owner ' . $item['uid']);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
logger('like: unknown owner ' . $item['uid']);
|
||||
return false;
|
||||
$owner_self_contact = ['uid' => 0, 'nick' => 'feed-item'];
|
||||
}
|
||||
|
||||
// Retrieve the current logged in user's public contact
|
||||
|
|
Loading…
Reference in a new issue