mirror of
https://github.com/friendica/friendica
synced 2025-05-01 17:04:25 +02:00
The query condition for active users are unified
This commit is contained in:
parent
692a633dc8
commit
7e73283949
19 changed files with 33 additions and 37 deletions
|
@ -63,7 +63,7 @@ class PubSub extends \Friendica\BaseModule
|
|||
$nickname = $this->parameters['nickname'] ?? '';
|
||||
$contact_id = $this->parameters['cid'] ?? 0;
|
||||
|
||||
$importer = $this->database->selectFirst('user', [], ['nickname' => $nickname, 'account_expired' => false, 'account_removed' => false]);
|
||||
$importer = $this->database->selectFirst('user', [], ['nickname' => $nickname, 'verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]);
|
||||
if (!$importer) {
|
||||
throw new HTTPException\OKException();
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ class PubSub extends \Friendica\BaseModule
|
|||
$this->logger->notice('Subscription start.', ['from' => $this->request->getRemoteAddress(), 'mode' => $hub_mode, 'nickname' => $nickname]);
|
||||
$this->logger->debug('Data: ', ['get' => $request]);
|
||||
|
||||
$owner = $this->database->selectFirst('user', ['uid'], ['nickname' => $nickname, 'account_expired' => false, 'account_removed' => false]);
|
||||
$owner = $this->database->selectFirst('user', ['uid'], ['nickname' => $nickname, 'verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]);
|
||||
if (!$owner) {
|
||||
$this->logger->notice('Local account not found.', ['nickname' => $nickname]);
|
||||
throw new HTTPException\NotFoundException();
|
||||
|
|
|
@ -111,7 +111,7 @@ class PubSubHubBub extends \Friendica\BaseModule
|
|||
}
|
||||
|
||||
// fetch user from database given the nickname
|
||||
$condition = ['nickname' => $nickname, 'account_expired' => false, 'account_removed' => false];
|
||||
$condition = ['nickname' => $nickname, 'verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false];
|
||||
$owner = $this->database->selectFirst('user', ['uid', 'nickname'], $condition);
|
||||
if (!$owner) {
|
||||
$this->logger->notice('Local account not found', ['nickname' => $nickname, 'topic' => $hub_topic, 'callback' => $hub_callback]);
|
||||
|
|
|
@ -74,7 +74,7 @@ class Salmon extends \Friendica\BaseModule
|
|||
|
||||
$this->logger->debug('New Salmon', ['nickname' => $nickname, 'xml' => $xml]);
|
||||
|
||||
$importer = $this->database->selectFirst('user', [], ['nickname' => $nickname, 'account_expired' => false, 'account_removed' => false]);
|
||||
$importer = $this->database->selectFirst('user', [], ['nickname' => $nickname, 'verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]);
|
||||
if (!$this->database->isResult($importer)) {
|
||||
throw new HTTPException\InternalServerErrorException();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue