From 6e45514e2c03646143ac1776a13d4958125a1776 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Tue, 4 Feb 2020 22:05:56 +0100 Subject: [PATCH] Move Notify::TYPE_CONFIRM --- boot.php | 1 - include/enotify.php | 2 +- mod/dfrn_confirm.php | 5 +++-- mod/settings.php | 4 ++-- src/Model/Notify/Type.php | 2 ++ 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/boot.php b/boot.php index f708ff8820..759e4e24f1 100644 --- a/boot.php +++ b/boot.php @@ -140,7 +140,6 @@ define('MAX_LIKERS', 75); * Email notification options * @{ */ -define('NOTIFY_CONFIRM', 2); define('NOTIFY_WALL', 4); define('NOTIFY_COMMENT', 8); define('NOTIFY_MAIL', 16); diff --git a/include/enotify.php b/include/enotify.php index 141fd36757..f51c88eae8 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -339,7 +339,7 @@ function notification($params) $hsitelink = sprintf($sitelink, ''.$sitename.''); } - if ($params['type'] == NOTIFY_CONFIRM) { + if ($params['type'] == Notify\Type::CONFIRM) { if ($params['verb'] == Activity::FRIEND) { // mutual connection $itemlink = $params['link']; $subject = $l10n->t('[Friendica:Notify] Connection accepted'); diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 60a96a9266..a8544ca7dc 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -26,6 +26,7 @@ use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Group; +use Friendica\Model\Notify\Type; use Friendica\Model\User; use Friendica\Protocol\Activity; use Friendica\Util\Crypto; @@ -525,10 +526,10 @@ function dfrn_confirm_post(App $a, $handsfree = null) if (DBA::isResult($r)) { $combined = $r[0]; - if ($combined['notify-flags'] & NOTIFY_CONFIRM) { + if ($combined['notify-flags'] & Type::CONFIRM) { $mutual = ($new_relation == Contact::FRIEND); notification([ - 'type' => NOTIFY_CONFIRM, + 'type' => Type::CONFIRM, 'notify_flags' => $combined['notify-flags'], 'language' => $combined['language'], 'to_name' => $combined['username'], diff --git a/mod/settings.php b/mod/settings.php index 3a9d911042..a12d8a71f0 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -1230,8 +1230,8 @@ function settings_content(App $a) '$h_not' => DI::l10n()->t('Notification Settings'), '$lbl_not' => DI::l10n()->t('Send a notification email when:'), - '$notify1' => ['notify1', DI::l10n()->t('You receive an introduction'), ($notify & Type::INTRO), NOTIFY_INTRO, ''], - '$notify2' => ['notify2', DI::l10n()->t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''], + '$notify1' => ['notify1', DI::l10n()->t('You receive an introduction'), ($notify & Type::INTRO), Type::INTRO, ''], + '$notify2' => ['notify2', DI::l10n()->t('Your introductions are confirmed'), ($notify & Type::CONFIRM), NOTIFY_CONFIRM, ''], '$notify3' => ['notify3', DI::l10n()->t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), NOTIFY_WALL, ''], '$notify4' => ['notify4', DI::l10n()->t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, ''], '$notify5' => ['notify5', DI::l10n()->t('You receive a private message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, ''], diff --git a/src/Model/Notify/Type.php b/src/Model/Notify/Type.php index 5f34e1aa39..550a818d44 100644 --- a/src/Model/Notify/Type.php +++ b/src/Model/Notify/Type.php @@ -9,4 +9,6 @@ class Type { /** @var int Introduction notifications */ const INTRO = 1; + /** @var int Notification about a confirmed introduction */ + const CONFIRM = 2; }