]> git.mxchange.org Git - friendica.git/commitdiff
Retraction does now work as well
authorMichael <heluecht@pirati.ca>
Wed, 3 May 2017 19:55:33 +0000 (19:55 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 3 May 2017 19:55:33 +0000 (19:55 +0000)
include/diaspora.php

index 121357829a806a46339c84564cdf7d7a23e6b12d..7e82ecc795f4c762b55cf2430e748e2f237fd438 100644 (file)
@@ -2379,11 +2379,16 @@ class Diaspora {
                        return false;
                }
 
+               if (!isset($contact["url"])) {
+                       $contact["url"] = $person["url"];
+               }
+
                $r = q("SELECT `id`, `parent`, `parent-uri`, `author-link` FROM `item` WHERE `guid` = '%s' AND `uid` = %d AND NOT `file` LIKE '%%[%%' LIMIT 1",
                        dbesc($target_guid),
                        intval($importer["uid"])
                );
                if (!$r) {
+                       logger("Target guid ".$target_guid." was not found for user ".$importer["uid"]);
                        return false;
                }
 
@@ -2429,7 +2434,7 @@ class Diaspora {
                $target_type = notags(unxmlify($data->target_type));
 
                $contact = self::contact_by_handle($importer["uid"], $sender);
-               if (!$contact) {
+               if (!$contact AND (in_array($target_type, array("Contact", "Person")))) {
                        logger("cannot find contact for sender: ".$sender." and user ".$importer["uid"]);
                        return false;
                }
@@ -2442,7 +2447,7 @@ class Diaspora {
                        case "Post": // "Post" will be supported in a future version
                        case "Reshare":
                        case "StatusMessage":
-                               return self::item_retraction($importer, $contact, $data);;
+                               return self::item_retraction($importer, $contact, $data);
 
                        case "Contact":
                        case "Person":