aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Lib/Activity.php19
-rw-r--r--Zotlabs/Lib/Libzot.php6
2 files changed, 6 insertions, 19 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 9c7b4e601..7de2ca7ec 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -652,24 +652,7 @@ class Activity {
else
return [];
- if ($i['obj']) {
- if (! is_array($i['obj'])) {
- $i['obj'] = json_decode($i['obj'],true);
- }
- $obj = self::encode_object($i['obj']);
- if ($obj)
- $ret['object'] = $obj;
- else
- return [];
- }
- else {
- $obj = self::encode_item($i);
- if ($obj)
- $ret['object'] = $obj;
- else
- return [];
- }
-
+ $ret['object'] = str_replace('/item/','/activity/',$i['mid']);
$ret['to'] = [ ACTIVITY_PUBLIC_INBOX ];
return $ret;
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index f4eb26463..ce9536cd4 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -1739,11 +1739,15 @@ class Libzot {
continue;
}
+ // reactions such as like and dislike could have an mid with /activity/ in it.
+ // Check for both forms in order to prevent duplicates.
- $r = q("select * from item where mid = '%s' and uid = %d limit 1",
+ $r = q("select * from item where mid in ('%s','%s') and uid = %d limit 1",
dbesc($arr['mid']),
+ dbesc(str_replace(z_root() . '/activity/', z_root() . '/item/', $arr['mid'])),
intval($channel['channel_id'])
);
+
if($r) {
// We already have this post.
$item_id = $r[0]['id'];