Move Notify::TYPE_TAGSELF
authornupplaPhil <admin+github@philipp.info>
Tue, 4 Feb 2020 21:13:06 +0000 (22:13 +0100)
committernupplaPhil <admin+github@philipp.info>
Wed, 5 Feb 2020 20:41:04 +0000 (21:41 +0100)
boot.php
include/enotify.php
mod/settings.php
src/Model/Notify/Type.php

index ec7d194..6e5777e 100644 (file)
--- 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);
index 03fa428..09b5e79 100644 (file)
@@ -116,7 +116,7 @@ function notification($params)
                $hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'/message/'.$params['item']['id'].'">'.$sitename.'</a>');
        }
 
-       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;
index bce3ac8..9a8a8ba 100644 (file)
@@ -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')],
index 9c7e3b6..c6f921b 100644 (file)
@@ -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;
 }