From a2a393a3c6c0446751f41c009dd5ae5a47b445d0 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 6 Jan 2015 12:31:44 +0100 Subject: [PATCH] Better check for Diaspora accounts so you can connect them from the /suggest page. --- include/Scrape.php | 9 +++++++++ include/items.php | 2 +- include/threads.php | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/Scrape.php b/include/Scrape.php index 99784af336..629f7a063b 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -750,5 +750,14 @@ function probe_url($url, $mode = PROBE_NORMAL) { logger('probe_url: ' . print_r($result,true), LOGGER_DEBUG); + // Trying if it maybe a diaspora account + if ($result['network'] == NETWORK_FEED) { + require_once('include/bbcode.php'); + $address = GetProfileUsername($url, "", true); + $result2 = probe_url($address, $mode); + if ($result2['network'] != "") + $result = $result2; + } + return $result; } diff --git a/include/items.php b/include/items.php index a7e996015e..c1352cebbe 100644 --- a/include/items.php +++ b/include/items.php @@ -1348,7 +1348,7 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa // Contacts from the statusnet connector are also added since you could add them in OStatus as well. if (!$arr['private'] AND in_array($arr["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, NETWORK_STATUSNET, ""))) - poco_check($arr["author-link"], $arr["author-name"], $arr["author-avatar"], "", $arr["received"]); + poco_check($arr["author-link"], $arr["author-name"], $arr["author-avatar"], "", $arr["received"], $arr['contact-id'], $arr['uid']); // Set "success_update" to the date of the last time we heard from this contact // This can be used to filter for inactive contacts and poco. diff --git a/include/threads.php b/include/threads.php index 28bf87f4da..8febe49e9b 100644 --- a/include/threads.php +++ b/include/threads.php @@ -153,6 +153,8 @@ function delete_thread_uri($itemuri, $uid) { } function delete_thread($itemid) { + // To-Do: + // There is no "uri" in the thread table ... $item = q("SELECT `uri`, `uid` FROM `thread` WHERE `iid` = %d", intval($itemid)); $result = q("DELETE FROM `thread` WHERE `iid` = %d", intval($itemid)); -- 2.39.5