aboutsummaryrefslogtreecommitdiffstats
path: root/mod/like.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-11-06 00:30:40 -0800
committerfriendica <info@friendica.com>2012-11-06 00:30:40 -0800
commit417d1080d4495ea52469f5292d7bac00f1953eca (patch)
tree1f821443ab1427b6370ce83b9ea15e9061bfe6b5 /mod/like.php
parent82e74e3520a4208f762be23352ba2e1a0ccb91cf (diff)
downloadvolse-hubzilla-417d1080d4495ea52469f5292d7bac00f1953eca.tar.gz
volse-hubzilla-417d1080d4495ea52469f5292d7bac00f1953eca.tar.bz2
volse-hubzilla-417d1080d4495ea52469f5292d7bac00f1953eca.zip
likes working a bit better - not translateable yet
Diffstat (limited to 'mod/like.php')
-rwxr-xr-xmod/like.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/mod/like.php b/mod/like.php
index 973dc45f8..6a58d67bd 100755
--- a/mod/like.php
+++ b/mod/like.php
@@ -44,7 +44,7 @@ function like_content(&$a) {
if(! $item_id || (! $r)) {
logger('like: no item ' . $item_id);
- return;
+ killme();
}
$item = $r[0];
@@ -53,10 +53,16 @@ function like_content(&$a) {
if(! perm_is_allowed($owner_uid,$observer['xchan_hash'],'post_comments')) {
notice( t('Permission denied') . EOL);
- return;
+ killme();
}
- $remote_owner = $item['owner_xchan'];
+ $r = q("select * from xchan where xchan_hash = '%s' limit 1",
+ dbesc($item['owner_xchan'])
+ );
+ if($r)
+ $remote_owner = $r[0];
+ else
+ killme();
@@ -110,11 +116,10 @@ function like_content(&$a) {
// }
- $r = q("SELECT * FROM item WHERE verb = '%s' AND ( item_restrict & %d )
+ $r = q("SELECT * FROM item WHERE verb = '%s' AND item_restrict = 0
AND owner_xchan = '%s' AND ( parent = %d OR thr_parent = '%s') LIMIT 1",
dbesc($activity),
- intval(ITEM_DELETED),
- dbesc($remote_owner),
+ dbesc($remote_owner['xchan_hash']),
intval($item_id),
dbesc($item['uri'])
);
@@ -174,7 +179,7 @@ function like_content(&$a) {
$arr['parent'] = $item['id'];
$arr['parent_uri'] = $item['uri'];
$arr['thr_parent'] = $item['uri'];
- $arr['owner_xchan'] = $remote_owner;
+ $arr['owner_xchan'] = $remote_owner['xchan_hash'];
$arr['author_xchan'] = $observer['xchan_hash'];