Merge pull request #4589 from annando/issue-4369

OStatus: Only posts from followers will be imported (Issue 4369)
This commit is contained in:
Hypolite Petovan 2018-03-12 08:09:08 -04:00 committed by GitHub
commit 335b18769e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,8 +72,9 @@ class OStatus
$contact = null; $contact = null;
if ($aliaslink != '') { if ($aliaslink != '') {
$condition = ["`uid` = ? AND `alias` = ? AND `network` != ?", $condition = ["`uid` = ? AND `alias` = ? AND `network` != ? AND `rel` IN (?, ?)",
$importer["uid"], $aliaslink, NETWORK_STATUSNET]; $importer["uid"], $aliaslink, NETWORK_STATUSNET,
CONTACT_IS_SHARING, CONTACT_IS_FRIEND];
$contact = dba::selectFirst('contact', [], $condition); $contact = dba::selectFirst('contact', [], $condition);
} }
@ -82,14 +83,16 @@ class OStatus
$aliaslink = $author["author-link"]; $aliaslink = $author["author-link"];
} }
$condition = ["`uid` = ? AND `nurl` IN (?, ?) AND `network` != ?", $importer["uid"], $condition = ["`uid` = ? AND `nurl` IN (?, ?) AND `network` != ? AND `rel` IN (?, ?)",
normalise_link($author["author-link"]), normalise_link($aliaslink), NETWORK_STATUSNET]; $importer["uid"], normalise_link($author["author-link"]), normalise_link($aliaslink),
NETWORK_STATUSNET, CONTACT_IS_SHARING, CONTACT_IS_FRIEND];
$contact = dba::selectFirst('contact', [], $condition); $contact = dba::selectFirst('contact', [], $condition);
} }
if (!DBM::is_result($contact) && ($addr != '')) { if (!DBM::is_result($contact) && ($addr != '')) {
$condition = ["`uid` = ? AND `addr` = ? AND `network` != ?", $condition = ["`uid` = ? AND `addr` = ? AND `network` != ? AND `rel` IN (?, ?)",
$importer["uid"], $addr, NETWORK_STATUSNET]; $importer["uid"], $addr, NETWORK_STATUSNET,
CONTACT_IS_SHARING, CONTACT_IS_FRIEND];
$contact = dba::selectFirst('contact', [], $condition); $contact = dba::selectFirst('contact', [], $condition);
} }