aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-02-13 10:29:32 +0100
committerMario Vavti <mario@mariovavti.com>2018-02-13 10:29:32 +0100
commitb221c68e4b4da59ec9405a1c1bac87ceba7eb2ca (patch)
treea39f35ab62ecf8622e9d69163ef250f60976eb86
parentb7fb78245aca724248cc721134a360276a9f6d9c (diff)
downloadvolse-hubzilla-b221c68e4b4da59ec9405a1c1bac87ceba7eb2ca.tar.gz
volse-hubzilla-b221c68e4b4da59ec9405a1c1bac87ceba7eb2ca.tar.bz2
volse-hubzilla-b221c68e4b4da59ec9405a1c1bac87ceba7eb2ca.zip
fix parent id for likes in status notifications.
-rwxr-xr-xinclude/items.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php
index 6a6308da1..6fe9a6041 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2327,6 +2327,16 @@ function send_status_notifications($post_id,$item) {
$parent = 0;
+ if(array_key_exists('verb',$item) && (activity_match($item['verb'], ACTIVITY_LIKE) || activity_match($item['verb'], ACTIVITY_DISLIKE))) {
+
+ $r = q("select id from item where mid = '%s' and uid = %d limit 1",
+ dbesc($item['thr_parent']),
+ intval($item['uid'])
+ );
+
+ $thr_parent_id = $r[0]['id'];
+ }
+
$r = q("select channel_hash from channel where channel_id = %d limit 1",
intval($item['uid'])
);
@@ -2394,8 +2404,8 @@ function send_status_notifications($post_id,$item) {
'link' => $link,
'verb' => ACTIVITY_POST,
'otype' => 'item',
- 'parent' => $parent,
- 'parent_mid' => $item['parent_mid']
+ 'parent' => $thr_parent_id ? $thr_parent_id : $parent,
+ 'parent_mid' => $thr_parent_id ? $item['thr_parent'] : $item['parent_mid']
));
}