Rename notify classes according the feature name, not the table name

This commit is contained in:
Hypolite Petovan 2021-01-23 04:53:44 -05:00
parent a7fac5a76f
commit 82e094179c
25 changed files with 120 additions and 131 deletions

View file

@ -34,7 +34,6 @@ use Friendica\Core\Worker;
use Friendica\Database\Database;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Notify\Type;
use Friendica\Network\HTTPException;
use Friendica\Network\Probe;
use Friendica\Protocol\Activity;
@ -2499,12 +2498,12 @@ class Contact
Group::addMember(User::getDefaultGroup($importer['uid'], $contact_record["network"]), $contact_record['id']);
if (($user['notify-flags'] & Type::INTRO) &&
if (($user['notify-flags'] & Notification\Type::INTRO) &&
in_array($user['page-flags'], [User::PAGE_FLAGS_NORMAL])) {
notification([
'type' => Type::INTRO,
'otype' => Notify\ObjectType::INTRO,
'type' => Notification\Type::INTRO,
'otype' => Notification\ObjectType::INTRO,
'verb' => ($sharing ? Activity::FRIEND : Activity::FOLLOW),
'uid' => $user['uid'],
'cid' => $contact_record['id'],

View file

@ -25,7 +25,6 @@ use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Notify\Type;
use Friendica\Network\Probe;
use Friendica\Protocol\Activity;
use Friendica\Util\DateTimeFormat;
@ -181,8 +180,8 @@ class FContact
DBA::insert('intro', $fields);
notification([
'type' => Type::SUGGEST,
'otype' => Notify\ObjectType::INTRO,
'type' => Notification\Type::SUGGEST,
'otype' => Notification\ObjectType::INTRO,
'verb' => Activity::REQ_FRIEND,
'uid' => $owner['uid'],
'cid' => $from_contact['uid'],

View file

@ -24,9 +24,8 @@ namespace Friendica\Model;
use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\DI;
use Friendica\Database\DBA;
use Friendica\Model\Notify\Type;
use Friendica\DI;
use Friendica\Protocol\Activity;
use Friendica\Util\DateTimeFormat;
use Friendica\Worker\Delivery;
@ -84,8 +83,8 @@ class Mail
// send notifications.
$notif_params = [
'type' => Type::MAIL,
'otype' => Notify\ObjectType::MAIL,
'type' => Notification\Type::MAIL,
'otype' => Notification\ObjectType::MAIL,
'verb' => Activity::POST,
'uid' => $user['uid'],
'cid' => $msg['contact-id'],

View file

@ -48,13 +48,12 @@ use Psr\Log\LoggerInterface;
* @property-read string name_cache Full name of the contact subject
* @property-read string msg_cache Plaintext version of the notification text with a placeholder (`{0}`) for the subject contact's name.
*/
class Notify extends BaseModel
class Notification extends BaseModel
{
/** @var \Friendica\Repository\Notify */
/** @var \Friendica\Repository\Notification */
private $repo;
public function __construct(Database $dba, LoggerInterface $logger, \Friendica\Repository\Notify $repo, array $data = [])
public function __construct(Database $dba, LoggerInterface $logger, \Friendica\Repository\Notification $repo, array $data = [])
{
parent::__construct($dba, $logger, $data);

View file

@ -19,7 +19,7 @@
*
*/
namespace Friendica\Model\Notify;
namespace Friendica\Model\Notification;
/**
* Enum for different otypes of the Notify

View file

@ -19,7 +19,7 @@
*
*/
namespace Friendica\Model\Notify;
namespace Friendica\Model\Notification;
/**
* Enum for different types of the Notify