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

index 759e4e2..3f70876 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -140,7 +140,6 @@ define('MAX_LIKERS',    75);
  * Email notification options
  * @{
  */
-define('NOTIFY_WALL',         4);
 define('NOTIFY_COMMENT',      8);
 define('NOTIFY_MAIL',        16);
 define('NOTIFY_SUGGEST',     32);
index f51c88e..fe38fad 100644 (file)
@@ -212,7 +212,7 @@ function notification($params)
                $itemlink =  $params['link'];
        }
 
-       if ($params['type'] == NOTIFY_WALL) {
+       if ($params['type'] == Notify\Type::WALL) {
                $subject = $l10n->t('[Friendica:Notify] %s posted to your profile wall', $params['source_name']);
 
                $preamble = $l10n->t('%1$s posted to your profile wall at %2$s', $params['source_name'], $sitename);
index 3edf49f..717c656 100644 (file)
@@ -31,6 +31,7 @@ use Friendica\Model\Contact;
 use Friendica\Model\Conversation;
 use Friendica\Model\FileTag;
 use Friendica\Model\Item;
+use Friendica\Model\Notify\Type;
 use Friendica\Model\Photo;
 use Friendica\Model\Term;
 use Friendica\Network\HTTPException;
@@ -771,7 +772,7 @@ function item_post(App $a) {
        } else {
                if (($contact_record != $author) && !count($forum_contact)) {
                        notification([
-                               'type'         => NOTIFY_WALL,
+                               'type'         => Type::WALL,
                                'notify_flags' => $user['notify-flags'],
                                'language'     => $user['language'],
                                'to_name'      => $user['username'],
index a12d8a7..855a5a1 100644 (file)
@@ -1231,8 +1231,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), 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, ''],
+               '$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, ''],
                '$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, ''],
index 550a818..f026e08 100644 (file)
@@ -7,8 +7,10 @@ namespace Friendica\Model\Notify;
  */
 class Type
 {
-       /** @var int Introduction notifications */
+       /** @var int Notification about a introduction */
        const INTRO  = 1;
        /** @var int Notification about a confirmed introduction */
        const CONFIRM = 2;
+       /** @var int Notification about a post on your wall */
+       const WALL = 4;
 }