The GNU-Social import is removed

This commit is contained in:
Michael 2022-12-21 22:21:22 +00:00
parent 31e8574006
commit d75cd8a00a
5 changed files with 10 additions and 17 deletions

View file

@ -105,11 +105,10 @@ class Follow extends BaseModule
// Don't try to add a pending contact // Don't try to add a pending contact
$userContact = Contact::selectFirst(['pending'], [ $userContact = Contact::selectFirst(['pending'], [
"`uid` = ? AND ((`rel` != ?) OR (`network` = ?)) AND (`nurl` = ? OR `alias` = ? OR `alias` = ?) AND `network` != ?", "`uid` = ? AND ((`rel` != ?) OR (`network` = ?)) AND (`nurl` = ? OR `alias` = ? OR `alias` = ?)",
$uid, Contact::FOLLOWER, Protocol::DFRN, $uid, Contact::FOLLOWER, Protocol::DFRN,
Strings::normaliseLink($url), Strings::normaliseLink($url),
Strings::normaliseLink($url), $url, Strings::normaliseLink($url), $url]);
Protocol::STATUSNET]);
if (!empty($userContact['pending'])) { if (!empty($userContact['pending'])) {
$this->sysMessages->addNotice($this->t('You already added this contact.')); $this->sysMessages->addNotice($this->t('You already added this contact.'));

View file

@ -135,13 +135,13 @@ class Acl extends BaseModule
switch ($type) { switch ($type) {
case self::TYPE_MENTION_CONTACT_GROUP: case self::TYPE_MENTION_CONTACT_GROUP:
$condition = DBA::mergeConditions($condition, $condition = DBA::mergeConditions($condition,
["NOT `self` AND NOT `blocked` AND `notify` != ? AND NOT `network` IN (?, ?)", '', Protocol::OSTATUS, Protocol::STATUSNET ["NOT `self` AND NOT `blocked` AND `notify` != ? AND `network` != ?", '', Protocol::OSTATUS
]); ]);
break; break;
case self::TYPE_MENTION_CONTACT: case self::TYPE_MENTION_CONTACT:
$condition = DBA::mergeConditions($condition, $condition = DBA::mergeConditions($condition,
["NOT `self` AND NOT `blocked` AND `notify` != ? AND `network` != ?", '', Protocol::STATUSNET ["NOT `self` AND NOT `blocked` AND `notify` != ?", ''
]); ]);
break; break;

View file

@ -223,10 +223,6 @@ class PortableContacts extends BaseModule
if ($selectedFields['network']) { if ($selectedFields['network']) {
$entry['network'] = $contact['network']; $entry['network'] = $contact['network'];
if ($entry['network'] == Protocol::STATUSNET) {
$entry['network'] = Protocol::OSTATUS;
}
if (($entry['network'] == '') && ($contact['self'])) { if (($entry['network'] == '') && ($contact['self'])) {
$entry['network'] = Protocol::DFRN; $entry['network'] = Protocol::DFRN;
} }

View file

@ -1066,8 +1066,8 @@ class DFRN
$fields = ['id', 'uid', 'url', 'network', 'avatar-date', 'avatar', 'name-date', 'uri-date', 'addr', $fields = ['id', 'uid', 'url', 'network', 'avatar-date', 'avatar', 'name-date', 'uri-date', 'addr',
'name', 'nick', 'about', 'location', 'keywords', 'xmpp', 'bdyear', 'bd', 'hidden', 'contact-type']; 'name', 'nick', 'about', 'location', 'keywords', 'xmpp', 'bdyear', 'bd', 'hidden', 'contact-type'];
$condition = ["`uid` = ? AND `nurl` = ? AND `network` != ? AND NOT `pending` AND NOT `blocked`", $condition = ["`uid` = ? AND `nurl` = ? AND NOT `pending` AND NOT `blocked`",
$importer["importer_uid"], Strings::normaliseLink($author["link"]), Protocol::STATUSNET]; $importer["importer_uid"], Strings::normaliseLink($author["link"])];
if ($importer['account-type'] != User::ACCOUNT_TYPE_COMMUNITY) { if ($importer['account-type'] != User::ACCOUNT_TYPE_COMMUNITY) {
$condition = DBA::mergeConditions($condition, ['rel' => [Contact::SHARING, Contact::FRIEND]]); $condition = DBA::mergeConditions($condition, ['rel' => [Contact::SHARING, Contact::FRIEND]]);

View file

@ -103,9 +103,9 @@ class OStatus
*/ */
if ($aliaslink != '') { if ($aliaslink != '') {
$contact = DBA::selectFirst('contact', [], [ $contact = DBA::selectFirst('contact', [], [
"`uid` = ? AND `alias` = ? AND `network` != ? AND `rel` IN (?, ?)", "`uid` = ? AND `alias` = ? AND `rel` IN (?, ?)",
$importer['uid'], $importer['uid'],
$aliaslink, Protocol::STATUSNET, $aliaslink,
Contact::SHARING, Contact::FRIEND, Contact::SHARING, Contact::FRIEND,
]); ]);
} }
@ -116,11 +116,10 @@ class OStatus
} }
$contact = DBA::selectFirst('contact', [], [ $contact = DBA::selectFirst('contact', [], [
"`uid` = ? AND `nurl` IN (?, ?) AND `network` != ? AND `rel` IN (?, ?)", "`uid` = ? AND `nurl` IN (?, ?) AND `rel` IN (?, ?)",
$importer['uid'], $importer['uid'],
Strings::normaliseLink($author['author-link']), Strings::normaliseLink($author['author-link']),
Strings::normaliseLink($aliaslink), Strings::normaliseLink($aliaslink),
Protocol::STATUSNET,
Contact::SHARING, Contact::SHARING,
Contact::FRIEND, Contact::FRIEND,
]); ]);
@ -128,10 +127,9 @@ class OStatus
if (!DBA::isResult($contact) && ($addr != '')) { if (!DBA::isResult($contact) && ($addr != '')) {
$contact = DBA::selectFirst('contact', [], [ $contact = DBA::selectFirst('contact', [], [
"`uid` = ? AND `addr` = ? AND `network` != ? AND `rel` IN (?, ?)", "`uid` = ? AND `addr` = ? AND `rel` IN (?, ?)",
$importer['uid'], $importer['uid'],
$addr, $addr,
Protocol::STATUSNET,
Contact::SHARING, Contact::SHARING,
Contact::FRIEND, Contact::FRIEND,
]); ]);