Move Notify::TYPE_TAGSELF

This commit is contained in:
nupplaPhil 2020-02-04 22:13:06 +01:00
parent bd0be96fb3
commit 51260f234f
No known key found for this signature in database
GPG Key ID: D8365C3D36B77D90
4 changed files with 10 additions and 5 deletions

View File

@ -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);

View 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;

View 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')],

View 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;
}