X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FDFRN.php;h=1ab12089de0c0ff588262be44388ddda9b68e425;hb=dc69116572c7ab45987c6ecb19edfa1bca5068b7;hp=621f18e9833430ab581f89d533a2d89e512c0227;hpb=0b1f67f5b33cd9a57e9bebeec76cbb8898f2ab27;p=friendica.git diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 621f18e983..1ab12089de 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -88,7 +88,7 @@ class DFRN $contact['senderName'] = $contact['name']; if ($uid != 0) { - $condition = ['uid' => $uid, 'account_expired' => false, 'account_removed' => false]; + $condition = ['uid' => $uid, 'verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]; $user = DBA::selectFirst('user', [], $condition); if (!DBA::isResult($user)) { return []; @@ -608,7 +608,7 @@ class DFRN /// @Todo /// - Check real image type and image size - /// - Check which of these boths elements we should use + /// - Check which of these elements we should use $attributes = [ 'rel' => 'photo', 'type' => 'image/jpeg', @@ -878,7 +878,7 @@ class DFRN XML::addElement($doc, $entry, 'dfrn:diaspora_guid', $item['guid']); - // The signed text contains the content in Markdown, the sender handle and the signatur for the content + // The signed text contains the content in Markdown, the sender handle and the signature for the content // It is needed for relayed comments to Diaspora. if ($item['signed_text']) { $sign = base64_encode(json_encode(['signed_text' => $item['signed_text'],'signature' => '','signer' => ''])); @@ -1585,7 +1585,7 @@ class DFRN Logger::info('Process verb ' . $item['verb'] . ' and object-type ' . $item['object-type'] . ' for entrytype ' . $entrytype); if (($entrytype == self::TOP_LEVEL) && !empty($importer['id'])) { - // The filling of the the "contact" variable is done for legcy reasons + // The filling of the "contact" variable is done for legacy reasons // The functions below are partly used by ostatus.php as well - where we have this variable $contact = Contact::selectFirst([], ['id' => $importer['id']]); @@ -1713,7 +1713,7 @@ class DFRN * Checks if an incoming message is wanted * * @param array $item - * @param array $imporer + * @param array $importer * @return boolean Is the message wanted? */ private static function isSolicitedMessage(array $item, array $importer): bool @@ -2220,8 +2220,8 @@ class DFRN GServer::setProtocol($importer['gsid'], Post\DeliveryData::DFRN); } - // is it a public forum? Private forums aren't exposed with this method - $forum = intval(XML::getFirstNodeValue($xpath, '/atom:feed/dfrn:community/text()')); + // is it a public group? Private groups aren't exposed with this method + $group = intval(XML::getFirstNodeValue($xpath, '/atom:feed/dfrn:community/text()')); // The account type is new since 3.5.1 if ($xpath->query('/atom:feed/dfrn:account_type')->length > 0) { @@ -2235,17 +2235,17 @@ class DFRN // Updating the public contact as well Contact::update(['contact-type' => $accounttype], ['uid' => 0, 'nurl' => $importer['nurl']]); } - // A forum contact can either have set "forum" or "prv" - but not both + // A group contact can either have set "forum" or "prv" - but not both if ($accounttype == User::ACCOUNT_TYPE_COMMUNITY) { - // It's a forum, so either set the public or private forum flag - $condition = ['(`forum` != ? OR `prv` != ?) AND `id` = ?', $forum, !$forum, $importer['id']]; - Contact::update(['forum' => $forum, 'prv' => !$forum], $condition); + // It's a group, so either set the public or private forum flag + $condition = ['(`forum` != ? OR `prv` != ?) AND `id` = ?', $group, !$group, $importer['id']]; + Contact::update(['forum' => $group, 'prv' => !$group], $condition); // Updating the public contact as well - $condition = ['(`forum` != ? OR `prv` != ?) AND `uid` = 0 AND `nurl` = ?', $forum, !$forum, $importer['nurl']]; - Contact::update(['forum' => $forum, 'prv' => !$forum], $condition); + $condition = ['(`forum` != ? OR `prv` != ?) AND `uid` = 0 AND `nurl` = ?', $group, !$group, $importer['nurl']]; + Contact::update(['forum' => $group, 'prv' => !$group], $condition); } else { - // It's not a forum, so remove the flags + // It's not a group, so remove the flags $condition = ['(`forum` OR `prv`) AND `id` = ?', $importer['id']]; Contact::update(['forum' => false, 'prv' => false], $condition); @@ -2253,13 +2253,13 @@ class DFRN $condition = ['(`forum` OR `prv`) AND `uid` = 0 AND `nurl` = ?', $importer['nurl']]; Contact::update(['forum' => false, 'prv' => false], $condition); } - } elseif ($forum != $importer['forum']) { // Deprecated since 3.5.1 - $condition = ['`forum` != ? AND `id` = ?', $forum, $importer['id']]; - Contact::update(['forum' => $forum], $condition); + } elseif ($group != $importer['forum']) { // Deprecated since 3.5.1 + $condition = ['`forum` != ? AND `id` = ?', $group, $importer['id']]; + Contact::update(['forum' => $group], $condition); // Updating the public contact as well - $condition = ['`forum` != ? AND `uid` = 0 AND `nurl` = ?', $forum, $importer['nurl']]; - Contact::update(['forum' => $forum], $condition); + $condition = ['`forum` != ? AND `uid` = 0 AND `nurl` = ?', $group, $importer['nurl']]; + Contact::update(['forum' => $group], $condition); }