]> git.mxchange.org Git - friendica.git/commitdiff
Move Notify::TYPE_COMMENT
authornupplaPhil <admin+github@philipp.info>
Tue, 4 Feb 2020 21:09:00 +0000 (22:09 +0100)
committernupplaPhil <admin+github@philipp.info>
Wed, 5 Feb 2020 20:41:02 +0000 (21:41 +0100)
boot.php
include/enotify.php
mod/item.php
mod/settings.php
src/Model/Notify/Type.php

index 3f7087622a2467db979ff02e029a97f7fcb6df68..eafbc8da98fcd53f8c6bd092f80099431156a7a1 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -140,7 +140,6 @@ define('MAX_LIKERS',    75);
  * Email notification options
  * @{
  */
-define('NOTIFY_COMMENT',      8);
 define('NOTIFY_MAIL',        16);
 define('NOTIFY_SUGGEST',     32);
 define('NOTIFY_PROFILE',     64);
index fe38fad2d44be1c43b506dc88243bf610edfaf16..4c4e7e10d41d985b14bd5394ccdf6f83389ff637 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_COMMENT || $params['type'] == NOTIFY_TAGSELF) {
+       if ($params['type'] == Notify\Type::COMMENT || $params['type'] == NOTIFY_TAGSELF) {
                $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_COMMENT, NOTIFY_SHARE],
+               $condition = ['type' => [NOTIFY_TAGSELF, Notify\Type::COMMENT, NOTIFY_SHARE],
                        'link' => $params['link'], 'uid' => $params['uid']];
                if (DBA::exists('notify', $condition)) {
                        return false;
@@ -595,19 +595,19 @@ function check_item_notification($itemid, $uid, $notification_type) {
                $params['type'] = NOTIFY_TAGSELF;
                $params['verb'] = Activity::TAG;
        } elseif ($notification_type & UserItem::NOTIF_IMPLICIT_TAGGED) {
-               $params['type'] = NOTIFY_COMMENT;
+               $params['type'] = Notify\Type::COMMENT;
                $params['verb'] = Activity::POST;
        } elseif ($notification_type & UserItem::NOTIF_THREAD_COMMENT) {
-               $params['type'] = NOTIFY_COMMENT;
+               $params['type'] = Notify\Type::COMMENT;
                $params['verb'] = Activity::POST;
        } elseif ($notification_type & UserItem::NOTIF_DIRECT_COMMENT) {
-               $params['type'] = NOTIFY_COMMENT;
+               $params['type'] = Notify\Type::COMMENT;
                $params['verb'] = Activity::POST;
        } elseif ($notification_type & UserItem::NOTIF_COMMENT_PARTICIPATION) {
-               $params['type'] = NOTIFY_COMMENT;
+               $params['type'] = Notify\Type::COMMENT;
                $params['verb'] = Activity::POST;
        } elseif ($notification_type & UserItem::NOTIF_ACTIVITY_PARTICIPATION) {
-               $params['type'] = NOTIFY_COMMENT;
+               $params['type'] = Notify\Type::COMMENT;
                $params['verb'] = Activity::POST;
        } else {
                return false;
index 717c656d186fbac3bd2a868f55c1edc08fe12293..69b5f52cdadbdb4d80d64a685554fdf00d6c914a 100644 (file)
@@ -752,7 +752,7 @@ function item_post(App $a) {
        if ($toplevel_item_id) {
                if ($contact_record != $author) {
                        notification([
-                               'type'         => NOTIFY_COMMENT,
+                               'type'         => Type::COMMENT,
                                'notify_flags' => $user['notify-flags'],
                                'language'     => $user['language'],
                                'to_name'      => $user['username'],
index 855a5a1ce058a8ba2f2fc6c12a947b832aaa0783..36350185294dc185defe5318bbfadfa9494a0d8a 100644 (file)
@@ -1233,7 +1233,7 @@ function settings_content(App $a)
                '$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), Type::CONFIRM, ''],
                '$notify3'      => ['notify3', DI::l10n()->t('Someone writes on your profile wall'), ($notify & Type::WALL), Type::WALL, ''],
-               '$notify4'      => ['notify4', DI::l10n()->t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, ''],
+               '$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 & NOTIFY_MAIL), NOTIFY_MAIL, ''],
                '$notify6'  => ['notify6', DI::l10n()->t('You receive a friend suggestion'), ($notify & NOTIFY_SUGGEST), NOTIFY_SUGGEST, ''],
                '$notify7'  => ['notify7', DI::l10n()->t('You are tagged in a post'), ($notify & NOTIFY_TAGSELF), NOTIFY_TAGSELF, ''],
index f026e081fdccc328e7e873045196e7a09e5692fc..440dde63e1d75d37e2e042bd319b1b8348025c15 100644 (file)
@@ -13,4 +13,6 @@ class Type
        const CONFIRM = 2;
        /** @var int Notification about a post on your wall */
        const WALL = 4;
+       /** @var int Notification about a followup comment */
+       const COMMENT = 8;
 }