From 51260f234f49e40c5e9f1c30536043ff0afac9db Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Tue, 4 Feb 2020 22:13:06 +0100 Subject: [PATCH] Move Notify::TYPE_TAGSELF --- boot.php | 1 - include/enotify.php | 6 +++--- mod/settings.php | 2 +- src/Model/Notify/Type.php | 6 ++++++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/boot.php b/boot.php index ec7d194a94..6e5777e6be 100644 --- a/boot.php +++ b/boot.php @@ -140,7 +140,6 @@ define('MAX_LIKERS', 75); * Email notification options * @{ */ -define('NOTIFY_TAGSELF', 128); define('NOTIFY_TAGSHARE', 256); define('NOTIFY_POKE', 512); define('NOTIFY_SHARE', 1024); diff --git a/include/enotify.php b/include/enotify.php index 03fa428e89..09b5e79057 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -116,7 +116,7 @@ function notification($params) $hsitelink = sprintf($sitelink, ''.$sitename.''); } - if ($params['type'] == Notify\Type::COMMENT || $params['type'] == NOTIFY_TAGSELF) { + if ($params['type'] == Notify\Type::COMMENT || $params['type'] == Notify\Type::TAG_SELF) { $thread = Item::selectFirstThreadForUser($params['uid'], ['ignored'], ['iid' => $parent_id, 'deleted' => false]); if (DBA::isResult($thread) && $thread['ignored']) { Logger::log('Thread ' . $parent_id . ' will be ignored', Logger::DEBUG); @@ -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_TAGSELF, Notify\Type::COMMENT, NOTIFY_SHARE], + $condition = ['type' => [Notify\Type::TAG_SELF, Notify\Type::COMMENT, NOTIFY_SHARE], 'link' => $params['link'], 'uid' => $params['uid']]; if (DBA::exists('notify', $condition)) { return false; @@ -592,7 +592,7 @@ function check_item_notification($itemid, $uid, $notification_type) { $params['type'] = NOTIFY_SHARE; $params['verb'] = Activity::POST; } elseif ($notification_type & UserItem::NOTIF_EXPLICIT_TAGGED) { - $params['type'] = NOTIFY_TAGSELF; + $params['type'] = Notify\Type::TAG_SELF; $params['verb'] = Activity::TAG; } elseif ($notification_type & UserItem::NOTIF_IMPLICIT_TAGGED) { $params['type'] = Notify\Type::COMMENT; diff --git a/mod/settings.php b/mod/settings.php index bce3ac8be5..9a8a8ba270 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -1236,7 +1236,7 @@ function settings_content(App $a) '$notify4' => ['notify4', DI::l10n()->t('Someone writes a followup comment'), ($notify & Type::COMMENT), Type::COMMENT, ''], '$notify5' => ['notify5', DI::l10n()->t('You receive a private message'), ($notify & Type::MAIL), Type::MAIL, ''], '$notify6' => ['notify6', DI::l10n()->t('You receive a friend suggestion'), ($notify & Type::SUGGEST), Type::SUGGEST, ''], - '$notify7' => ['notify7', DI::l10n()->t('You are tagged in a post'), ($notify & NOTIFY_TAGSELF), NOTIFY_TAGSELF, ''], + '$notify7' => ['notify7', DI::l10n()->t('You are tagged in a post'), ($notify & Type::TAG_SELF), Type::TAG_SELF, ''], '$notify8' => ['notify8', DI::l10n()->t('You are poked/prodded/etc. in a post'), ($notify & NOTIFY_POKE), NOTIFY_POKE, ''], '$desktop_notifications' => ['desktop_notifications', DI::l10n()->t('Activate desktop notifications') , false, DI::l10n()->t('Show desktop popup on new notifications')], diff --git a/src/Model/Notify/Type.php b/src/Model/Notify/Type.php index 9c7e3b6deb..c6f921b456 100644 --- a/src/Model/Notify/Type.php +++ b/src/Model/Notify/Type.php @@ -19,4 +19,10 @@ class Type const MAIL = 16; /** @var int Notification about a friend suggestion */ const SUGGEST = 32; + /** @var int Unknown Notification + * @deprecated + */ + const PROFILE = 64; + /** @var int Notification about being tagged in a post */ + const TAG_SELF = 128; }