]> git.mxchange.org Git - friendica.git/commitdiff
"unsharing" is now done different
authorMichael <heluecht@pirati.ca>
Fri, 16 Jun 2017 16:39:17 +0000 (16:39 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 16 Jun 2017 16:39:17 +0000 (16:39 +0000)
include/diaspora.php

index 6b899a279928e309fe3d8bf318688b8f7c4787aa..696a612bbc6a1714745ed82754f64476398cf15b 100644 (file)
@@ -3001,9 +3001,15 @@ class Diaspora {
         *
         * @return int The result of the transmission
         */
-       public static function send_share($owner,$contact) {
+       public static function send_share($owner, $contact) {
 
                /// @todo support the different possible combinations of "following" and "sharing"
+/*
+                               if (in_array($contact["rel"], array(CONTACT_IS_FRIEND, CONTACT_IS_FOLLOWER))) {
+                               $new_relation = CONTACT_IS_FRIEND;
+                               $new_relation = CONTACT_IS_SHARING;
+                               $new_relation = CONTACT_IS_FOLLOWER;
+*/
                $message = array("author" => self::my_handle($owner),
                                "recipient" => $contact["addr"],
                                "following" => "true",
@@ -3022,15 +3028,16 @@ class Diaspora {
         *
         * @return int The result of the transmission
         */
-       public static function send_unshare($owner,$contact) {
+       public static function send_unshare($owner, $contact) {
 
                $message = array("author" => self::my_handle($owner),
-                               "target_guid" => $owner["guid"],
-                               "target_type" => "Person");
+                               "recipient" => $contact["addr"],
+                               "following" => "false",
+                               "sharing" => "false");
 
                logger("Send unshare ".print_r($message, true), LOGGER_DEBUG);
 
-               return self::build_and_transmit($owner, $contact, "retraction", $message);
+               return self::build_and_transmit($owner, $contact, "contact", $message);
        }
 
        /**