Merge pull request #7759 from nupplaphil/task/mod_receive

Move mod/receive to src/Module/Diaspora/receive
This commit is contained in:
Hypolite Petovan 2019-10-21 11:59:13 -04:00 committed by GitHub
commit 2edccf9341
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 182 additions and 103 deletions

View file

@ -18,7 +18,6 @@ use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model\Photo;
use Friendica\Model\TwoFactor\AppSpecificPassword;
use Friendica\Object\Image;
use Friendica\Util\Crypto;
@ -105,6 +104,27 @@ class User
return DBA::selectFirst('user', $fields, ['uid' => $uid]);
}
/**
* Returns a user record based on it's GUID
*
* @param string $guid The guid of the user
* @param array $fields The fields to retrieve
* @param bool $active True, if only active records are searched
*
* @return array|boolean User record if it exists, false otherwise
* @throws Exception
*/
public static function getByGuid(string $guid, array $fields = [], bool $active = true)
{
if ($active) {
$cond = ['guid' => $guid, 'account_expired' => false, 'account_removed' => false];
} else {
$cond = ['guid' => $guid];
}
return DBA::selectFirst('user', $fields, $cond);
}
/**
* @param string $nickname
* @param array $fields