From d826515ba8d2d1d78abed6701df3c2c3550e87df Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 13 Feb 2018 11:01:58 +0100 Subject: since we only save the parent mid in notify we must look for thr_parent when dealing with likes --- Zotlabs/Module/Ping.php | 13 ++++++++++++- include/items.php | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php index 96ade22c0..eab49d69e 100644 --- a/Zotlabs/Module/Ping.php +++ b/Zotlabs/Module/Ping.php @@ -268,7 +268,18 @@ class Ping extends \Zotlabs\Web\Controller { $mid = basename($tt['link']); - $b64mid = ((strpos($mid, 'b64.' === 0)) ? $mid : 'b64.' . base64url_encode($mid)); + if(in_array($tt['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) { + // we need the thread parent + $r = q("select thr_parent from item where mid = '%s' and uid = %d limit 1", + dbesc($mid), + intval(local_channel()) + ); + + $b64mid = ((strpos($r[0]['thr_parent'], 'b64.' === 0)) ? $r[0]['thr_parent'] : 'b64.' . base64url_encode($r[0]['thr_parent'])); + } + else { + $b64mid = ((strpos($mid, 'b64.' === 0)) ? $mid : 'b64.' . base64url_encode($mid)); + } $notifs[] = array( 'notify_link' => z_root() . '/notify/view/' . $tt['id'], diff --git a/include/items.php b/include/items.php index 6fe9a6041..04962ec76 100755 --- a/include/items.php +++ b/include/items.php @@ -2402,7 +2402,7 @@ function send_status_notifications($post_id,$item) { 'to_xchan' => $r[0]['channel_hash'], 'item' => $item, 'link' => $link, - 'verb' => ACTIVITY_POST, + 'verb' => $item['verb'], 'otype' => 'item', 'parent' => $thr_parent_id ? $thr_parent_id : $parent, 'parent_mid' => $thr_parent_id ? $item['thr_parent'] : $item['parent_mid'] -- cgit v1.2.3