]> git.mxchange.org Git - friendica.git/commitdiff
Everything tested, one open to-do
authorMichael Vogel <icarus@dabo.de>
Wed, 16 Mar 2016 23:37:44 +0000 (00:37 +0100)
committerMichael Vogel <icarus@dabo.de>
Wed, 16 Mar 2016 23:37:44 +0000 (00:37 +0100)
include/delivery.php
include/diaspora.php

index 9ac9f2391b6d2001c89414e6aba7d5b70ab46cbe..fe337743820dcb85940262fefdb4abe099c4d530 100644 (file)
@@ -243,7 +243,8 @@ function delivery_run(&$argv, &$argc){
                        if ((strlen($parent['allow_cid']))
                                || (strlen($parent['allow_gid']))
                                || (strlen($parent['deny_cid']))
-                               || (strlen($parent['deny_gid']))) {
+                               || (strlen($parent['deny_gid']))
+                               || $parent["private"]) {
                                $public_message = false; // private recipients, not public
                        }
 
index 4a6cbad1310daaf03b9e3869298d65268b2266fc..870466497d1091526540790519136c343da8237a 100644 (file)
  * - send comment
  * - send like
  * - send mail
+ * - send status retraction
+ * - send comment retraction on own post
+ * - send comment retraction on diaspora post
+ * - send like retraction on own post
+ * - send like retraction on diaspora post
  * - receive status
  * - receive reshare
  * - receive comment
  * - receive connect request
  * - receive profile data
  * - receive mail
+ * - receive comment retraction
+ * - receive like retraction
  * - relay comment
  * - relay like
- * -
- * -
+ * - relay comment retraction from diaspora
+ * - relay comment retraction from friendica
+ * - relay like retraction from diaspora
+ * - relay like retraction from friendica
  *
- * Unchecked:
+ * Should work:
  * - receive account deletion
  * - send share
  * - send unshare
- * - send status retraction
- * - send comment retraction
- * - send like retraction
- * - relay comment retraction
- * - relay like retraction
- * -
+ *
+ * Unchecked:
  */
 
 require_once("include/items.php");
@@ -2394,7 +2399,10 @@ class diaspora {
                        intval($item["id"]));
 
                if (!$r) {
-                       logger("Couldn't fetch signatur for contact ".$contact["addr"]." at item ".$item["guid"]." (".$item["id"].")", LOGGER_DEBUG);
+                       if ($item["deleted"])
+                               return self::send_retraction($item, $owner, $contact, $public_batch);
+
+                       logger("Couldn't fetch signatur for item ".$item["guid"]." (".$item["id"].")", LOGGER_DEBUG);
                        return false;
                }
 
@@ -2436,6 +2444,9 @@ class diaspora {
 
        public static function send_retraction($item, $owner, $contact, $public_batch = false) {
 
+               /// @todo Fetch handle from every contact (via gcontact)
+               $itemaddr = self::handle_from_contact($item["contact-id"]);
+
                $myaddr = self::my_handle($owner);
 
                // Check whether the retraction is for a top-level post or whether it's a relayable
@@ -2451,9 +2462,16 @@ class diaspora {
 
                $message = array("target_guid" => $item['guid'],
                                "target_type" => $target_type,
-                               "sender_handle" => $myaddr,
+                               "sender_handle" => $itemaddr,
                                "target_author_signature" => base64_encode(rsa_sign($signed_text,$owner['uprvkey'],'sha256')));
 
+               if ($itemaddr != $myaddr) {
+                       $message["parent_author_signature"] = $message["target_author_signature"];
+                       unset($message["target_author_signature"]);
+               }
+
+               logger("Got message ".print_r($message, true), LOGGER_DEBUG);
+
                return self::build_and_transmit($owner, $contact, $msg_type, $message, $public_batch, $item["guid"]);
        }