diff --git a/include/diaspora.php b/include/diaspora.php index 6b899a279..696a612bb 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -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); } /**