]> git.mxchange.org Git - friendica.git/commitdiff
Avoid storing an icid value when iaid is stored/Fix item retraction
authorMichael <heluecht@pirati.ca>
Sat, 7 Jul 2018 16:38:01 +0000 (16:38 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 7 Jul 2018 16:38:01 +0000 (16:38 +0000)
src/Model/Item.php
src/Protocol/Diaspora.php

index a95bc184f1dfcef2f958dd02851daf56a242ded7..87ea80005eedb72bdaf6a9184664ee20d0d45a20 100644 (file)
@@ -752,7 +752,9 @@ class Item extends BaseObject
                        if (!empty($item['plink'])) {
                                $content_fields['plink'] = $item['plink'];
                        }
-                       if (self::updateActivity($content_fields, ['uri' => $item['uri']])) {
+                       if ((self::activityToIndex($item['verb']) >= 0) || !empty($item['iaid'])) {
+                               self::updateActivity($content_fields, ['uri' => $item['uri']]);
+
                                if (empty($item['iaid'])) {
                                        $item_activity = dba::selectFirst('item-activity', ['id'], ['uri' => $item['uri']]);
                                        if (DBM::is_result($item_activity)) {
index 7b55fc6820c2202041c1ceafd40562efee1a05c4..87f798427c29f5abd46cff04f3153115a1c76c92 100644 (file)
@@ -2709,10 +2709,11 @@ class Diaspora
 
                // When we receive a public retraction, we delete every item that we find.
                if ($importer['uid'] == 0) {
-                       $condition = ["`guid` = ? AND NOT `file` LIKE '%%[%%' AND NOT `deleted`", $target_guid];
+                       $condition = ['guid' => $target_guid, 'deleted' => false];
                } else {
-                       $condition = ["`guid` = ? AND `uid` = ? AND NOT `file` LIKE '%%[%%' AND NOT `deleted`", $target_guid, $importer['uid']];
+                       $condition = ['guid' => $target_guid, 'deleted' => false, 'uid' => $importer['uid']];
                }
+
                $r = Item::select($fields, $condition);
                if (!DBM::is_result($r)) {
                        logger("Target guid ".$target_guid." was not found on this system for user ".$importer['uid'].".");