Browse Source

Better check for Diaspora accounts so you can connect them from the /suggest page.

pull/1285/head
Michael Vogel 7 years ago
parent
commit
a2a393a3c6
3 changed files with 12 additions and 1 deletions
  1. +9
    -0
      include/Scrape.php
  2. +1
    -1
      include/items.php
  3. +2
    -0
      include/threads.php

+ 9
- 0
include/Scrape.php View File

@ -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;
}

+ 1
- 1
include/items.php View File

@ -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.


+ 2
- 0
include/threads.php View File

@ -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));


Loading…
Cancel
Save