Move Notify::TYPE_TAGSELF
This commit is contained in:
parent
bd0be96fb3
commit
51260f234f
4 changed files with 10 additions and 5 deletions
1
boot.php
1
boot.php
|
@ -140,7 +140,6 @@ define('MAX_LIKERS', 75);
|
||||||
* Email notification options
|
* Email notification options
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
define('NOTIFY_TAGSELF', 128);
|
|
||||||
define('NOTIFY_TAGSHARE', 256);
|
define('NOTIFY_TAGSHARE', 256);
|
||||||
define('NOTIFY_POKE', 512);
|
define('NOTIFY_POKE', 512);
|
||||||
define('NOTIFY_SHARE', 1024);
|
define('NOTIFY_SHARE', 1024);
|
||||||
|
|
|
@ -116,7 +116,7 @@ function notification($params)
|
||||||
$hsitelink = sprintf($sitelink, '<a href="'.$siteurl.'/message/'.$params['item']['id'].'">'.$sitename.'</a>');
|
$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]);
|
$thread = Item::selectFirstThreadForUser($params['uid'], ['ignored'], ['iid' => $parent_id, 'deleted' => false]);
|
||||||
if (DBA::isResult($thread) && $thread['ignored']) {
|
if (DBA::isResult($thread) && $thread['ignored']) {
|
||||||
Logger::log('Thread ' . $parent_id . ' will be ignored', Logger::DEBUG);
|
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.
|
// Check to see if there was already a tag notify or comment notify for this post.
|
||||||
// If so don't create a second notification
|
// If so don't create a second notification
|
||||||
/// @todo In the future we should store the notification with the highest "value" and replace notifications
|
/// @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']];
|
'link' => $params['link'], 'uid' => $params['uid']];
|
||||||
if (DBA::exists('notify', $condition)) {
|
if (DBA::exists('notify', $condition)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -592,7 +592,7 @@ function check_item_notification($itemid, $uid, $notification_type) {
|
||||||
$params['type'] = NOTIFY_SHARE;
|
$params['type'] = NOTIFY_SHARE;
|
||||||
$params['verb'] = Activity::POST;
|
$params['verb'] = Activity::POST;
|
||||||
} elseif ($notification_type & UserItem::NOTIF_EXPLICIT_TAGGED) {
|
} elseif ($notification_type & UserItem::NOTIF_EXPLICIT_TAGGED) {
|
||||||
$params['type'] = NOTIFY_TAGSELF;
|
$params['type'] = Notify\Type::TAG_SELF;
|
||||||
$params['verb'] = Activity::TAG;
|
$params['verb'] = Activity::TAG;
|
||||||
} elseif ($notification_type & UserItem::NOTIF_IMPLICIT_TAGGED) {
|
} elseif ($notification_type & UserItem::NOTIF_IMPLICIT_TAGGED) {
|
||||||
$params['type'] = Notify\Type::COMMENT;
|
$params['type'] = Notify\Type::COMMENT;
|
||||||
|
|
|
@ -1236,7 +1236,7 @@ function settings_content(App $a)
|
||||||
'$notify4' => ['notify4', DI::l10n()->t('Someone writes a followup comment'), ($notify & Type::COMMENT), Type::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 & Type::MAIL), Type::MAIL, ''],
|
'$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, ''],
|
'$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, ''],
|
'$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')],
|
'$desktop_notifications' => ['desktop_notifications', DI::l10n()->t('Activate desktop notifications') , false, DI::l10n()->t('Show desktop popup on new notifications')],
|
||||||
|
|
|
@ -19,4 +19,10 @@ class Type
|
||||||
const MAIL = 16;
|
const MAIL = 16;
|
||||||
/** @var int Notification about a friend suggestion */
|
/** @var int Notification about a friend suggestion */
|
||||||
const SUGGEST = 32;
|
const SUGGEST = 32;
|
||||||
|
/** @var int Unknown Notification
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
const PROFILE = 64;
|
||||||
|
/** @var int Notification about being tagged in a post */
|
||||||
|
const TAG_SELF = 128;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue