app.net, pump.io, statusnet, twitter: There were situations, when contacts were added by mistake.

pull/203/head
Michael Vogel 2014-06-25 01:20:04 +02:00
parent b81129f070
commit 0a6d1f9e49
5 changed files with 21 additions and 0 deletions

View File

@ -856,6 +856,8 @@ function appnet_createpost($a, $uid, $post, $me, $user, $ownid, $createuser, $th
}
}
}
// Don't create accounts of people who just comment something
$createuser = false;
} else
$postarray['thr-parent'] = $postarray['uri'];
@ -1042,6 +1044,8 @@ function appnet_fetchcontact($a, $uid, $contact, $me, $create_user) {
if(!count($r) AND !$create_user)
return($me);
if ($contact["canonical_url"] == "")
return($me);
if (count($r) AND ($r[0]["readonly"] OR $r[0]["blocked"])) {
logger("appnet_fetchcontact: Contact '".$r[0]["nick"]."' is blocked or readonly.", LOGGER_DEBUG);
@ -1049,6 +1053,13 @@ function appnet_fetchcontact($a, $uid, $contact, $me, $create_user) {
}
if(!count($r)) {
if ($contact["name"] == "")
$contact["name"] = $contact["username"];
if ($contact["username"] == "")
$contact["username"] = $contact["name"];
// create contact record
q("INSERT INTO `contact` (`uid`, `created`, `url`, `nurl`, `addr`, `alias`, `notify`, `poll`,
`name`, `nick`, `photo`, `network`, `rel`, `priority`,

View File

@ -278,6 +278,9 @@ function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post, $cr
}
if ($contact_id <= 0) {
// To-Do:
// $contacts[$post->source_id] seems to be wrong by repeated posts
// must be changed in future
$contact_id = fbsync_fetch_contact($uid, $contacts[$post->source_id], $create_user);
if ($contact_id == -1) {

View File

@ -888,6 +888,9 @@ function pumpio_dolike(&$a, $uid, $self, $post, $own_id) {
function pumpio_get_contact($uid, $contact) {
if (($contact->url == "") OR ($contact->id == 0))
return(false);
$r = q("SELECT id FROM unique_contacts WHERE url='%s' LIMIT 1",
dbesc(normalise_link($contact->url)));

View File

@ -1059,6 +1059,8 @@ function statusnet_createpost($a, $uid, $post, $self, $create_user, $only_existi
} else
return(array());
}
// Don't create accounts of people who just comment something
$create_user = false;
} else
$postarray['parent-uri'] = $postarray['uri'];

View File

@ -1232,6 +1232,8 @@ function twitter_createpost($a, $uid, $post, $self, $create_user, $only_existing
} else
return(array());
}
// Don't create accounts of people who just comment something
$create_user = false;
} else
$postarray['parent-uri'] = $postarray['uri'];