X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdiaspora.php;h=3a211302460a866f483ac5e26f4331f7e5acc455;hb=683cdcc19ef261f5fe632838a1e14567fc874ba2;hp=e3a3dcd78c2e05d37d177b9f5b4a6e78db2cceb5;hpb=7be0020da929ea44b1acfdd789adf374f0065d33;p=friendica.git diff --git a/include/diaspora.php b/include/diaspora.php index e3a3dcd78c..3a21130246 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -2,43 +2,11 @@ /** * @file include/diaspora.php * @brief The implementation of the diaspora protocol - * - * Checklist: - * - * Checked: - * - send status - * - send comment - * - send like - * - send mail - * - send status retraction - * - send comment retraction on own post - * - send like retraction on own post - * - send comment retraction on diaspora post - * - send like retraction on diaspora post - * - receive status - * - receive reshare - * - receive comment - * - receive like - * - 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 - * - send share - * - * Should work: - * - receive account deletion - * - send unshare - * - * Unchecked: */ +/// @todo reshare of some reshare doesn't work well, see guid c1d534b0ed19013358694860008dbc6c +// 14f571c0f244013358694860008dbc6c + require_once("include/items.php"); require_once("include/bb2diaspora.php"); require_once("include/Scrape.php"); @@ -1000,6 +968,9 @@ class diaspora { * @return bool Success */ private function receive_account_deletion($importer, $data) { + + /// @todo Account deletion should remove the contact from the global contacts as well + $author = notags(unxmlify($data->author)); $contact = self::contact_by_handle($importer["uid"], $author); @@ -1819,12 +1790,10 @@ class diaspora { return; } - $g = q("SELECT `def_gid` FROM `user` WHERE `uid` = %d LIMIT 1", - intval($importer["uid"]) - ); + $def_gid = get_default_group($importer['uid'], $ret["network"]); - if($g && intval($g[0]["def_gid"])) - group_add_member($importer["uid"], "", $contact_record["id"], $g[0]["def_gid"]); + if(intval($def_gid)) + group_add_member($importer["uid"], "", $contact_record["id"], $def_gid); if($importer["page-flags"] == PAGE_NORMAL) { @@ -2117,10 +2086,11 @@ class diaspora { case "StatusMessage": return self::item_retraction($importer, $contact, $data);; + case "Contact": case "Person": /// @todo What should we do with an "unshare"? // Removing the contact isn't correct since we still can read the public items - //contact_remove($contact["id"]); + contact_remove($contact["id"]); return true; default: @@ -3120,12 +3090,6 @@ class diaspora { */ public static function store_like_signature($contact, $post_id) { - $enabled = intval(get_config('system','diaspora_enabled')); - if (!$enabled) { - logger('Diaspora support disabled, not storing like signature', LOGGER_DEBUG); - return false; - } - // Is the contact the owner? Then fetch the private key if (!$contact['self'] OR ($contact['uid'] == 0)) { logger("No owner post, so not storing signature", LOGGER_DEBUG); @@ -3189,12 +3153,6 @@ class diaspora { return false; } - $enabled = intval(get_config('system','diaspora_enabled')); - if (!$enabled) { - logger('Diaspora support disabled, not storing comment signature', LOGGER_DEBUG); - return false; - } - $contact["uprvkey"] = $uprvkey; $message = self::construct_comment($item, $contact);