From c6915dc6729e4ce73e5c0d890ba1b48feab6b232 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Tue, 4 Feb 2020 22:21:02 +0100 Subject: [PATCH] Move Notify::TYPE_SHARE --- boot.php | 1 - include/enotify.php | 6 +++--- src/Model/Notify/Type.php | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/boot.php b/boot.php index 84d4300341..df7dc85608 100644 --- a/boot.php +++ b/boot.php @@ -140,7 +140,6 @@ define('MAX_LIKERS', 75); * Email notification options * @{ */ -define('NOTIFY_SHARE', 1024); define('NOTIFY_SYSTEM', 32768); /* @}*/ diff --git a/include/enotify.php b/include/enotify.php index 31983d8947..6d261720e5 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -126,7 +126,7 @@ function notification($params) // Check to see if there was already a tag notify or comment notify for this post. // If so don't create a second notification /// @todo In the future we should store the notification with the highest "value" and replace notifications - $condition = ['type' => [Notify\Type::TAG_SELF, Notify\Type::COMMENT, NOTIFY_SHARE], + $condition = ['type' => [Notify\Type::TAG_SELF, Notify\Type::COMMENT, Notify\Type::SHARE], 'link' => $params['link'], 'uid' => $params['uid']]; if (DBA::exists('notify', $condition)) { return false; @@ -227,7 +227,7 @@ function notification($params) $itemlink = $params['link']; } - if ($params['type'] == NOTIFY_SHARE) { + if ($params['type'] == Notify\Type::SHARE) { $subject = $l10n->t('[Friendica:Notify] %s shared a new post', $params['source_name']); $preamble = $l10n->t('%1$s shared a new post at %2$s', $params['source_name'], $sitename); @@ -589,7 +589,7 @@ function check_item_notification($itemid, $uid, $notification_type) { } if ($notification_type & UserItem::NOTIF_SHARED) { - $params['type'] = NOTIFY_SHARE; + $params['type'] = Notify\Type::SHARE; $params['verb'] = Activity::POST; } elseif ($notification_type & UserItem::NOTIF_EXPLICIT_TAGGED) { $params['type'] = Notify\Type::TAG_SELF; diff --git a/src/Model/Notify/Type.php b/src/Model/Notify/Type.php index 80e5c49375..f15c1b76a7 100644 --- a/src/Model/Notify/Type.php +++ b/src/Model/Notify/Type.php @@ -31,4 +31,6 @@ class Type const TAG_SHARE = 256; /** @var int Notification about getting poked/prodded/etc. */ const POKE = 512; + /** @var int Notification about either a contact had posted something directly or the contact is a mentioned forum */ + const SHARE = 1024; }