Move Notify::TYPE_WALL

pull/8239/head
nupplaPhil 2020-02-04 22:07:10 +01:00
parent 6e45514e2c
commit b86ad37001
No known key found for this signature in database
GPG Key ID: D8365C3D36B77D90
5 changed files with 8 additions and 6 deletions

View File

@ -140,7 +140,6 @@ define('MAX_LIKERS', 75);
* Email notification options * Email notification options
* @{ * @{
*/ */
define('NOTIFY_WALL', 4);
define('NOTIFY_COMMENT', 8); define('NOTIFY_COMMENT', 8);
define('NOTIFY_MAIL', 16); define('NOTIFY_MAIL', 16);
define('NOTIFY_SUGGEST', 32); define('NOTIFY_SUGGEST', 32);

View File

@ -212,7 +212,7 @@ function notification($params)
$itemlink = $params['link']; $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']); $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); $preamble = $l10n->t('%1$s posted to your profile wall at %2$s', $params['source_name'], $sitename);

View File

@ -31,6 +31,7 @@ use Friendica\Model\Contact;
use Friendica\Model\Conversation; use Friendica\Model\Conversation;
use Friendica\Model\FileTag; use Friendica\Model\FileTag;
use Friendica\Model\Item; use Friendica\Model\Item;
use Friendica\Model\Notify\Type;
use Friendica\Model\Photo; use Friendica\Model\Photo;
use Friendica\Model\Term; use Friendica\Model\Term;
use Friendica\Network\HTTPException; use Friendica\Network\HTTPException;
@ -771,7 +772,7 @@ function item_post(App $a) {
} else { } else {
if (($contact_record != $author) && !count($forum_contact)) { if (($contact_record != $author) && !count($forum_contact)) {
notification([ notification([
'type' => NOTIFY_WALL, 'type' => Type::WALL,
'notify_flags' => $user['notify-flags'], 'notify_flags' => $user['notify-flags'],
'language' => $user['language'], 'language' => $user['language'],
'to_name' => $user['username'], 'to_name' => $user['username'],

View File

@ -1231,8 +1231,8 @@ function settings_content(App $a)
'$h_not' => DI::l10n()->t('Notification Settings'), '$h_not' => DI::l10n()->t('Notification Settings'),
'$lbl_not' => DI::l10n()->t('Send a notification email when:'), '$lbl_not' => DI::l10n()->t('Send a notification email when:'),
'$notify1' => ['notify1', DI::l10n()->t('You receive an introduction'), ($notify & Type::INTRO), Type::INTRO, ''], '$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, ''], '$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 & NOTIFY_WALL), NOTIFY_WALL, ''], '$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 & NOTIFY_COMMENT), NOTIFY_COMMENT, ''],
'$notify5' => ['notify5', DI::l10n()->t('You receive a private message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, ''], '$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, ''], '$notify6' => ['notify6', DI::l10n()->t('You receive a friend suggestion'), ($notify & NOTIFY_SUGGEST), NOTIFY_SUGGEST, ''],

View File

@ -7,8 +7,10 @@ namespace Friendica\Model\Notify;
*/ */
class Type class Type
{ {
/** @var int Introduction notifications */ /** @var int Notification about a introduction */
const INTRO = 1; const INTRO = 1;
/** @var int Notification about a confirmed introduction */ /** @var int Notification about a confirmed introduction */
const CONFIRM = 2; const CONFIRM = 2;
/** @var int Notification about a post on your wall */
const WALL = 4;
} }