Move Notify::TYPE_SHARE

This commit is contained in:
nupplaPhil 2020-02-04 22:21:02 +01:00
parent a78e19ea76
commit c6915dc672
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
3 changed files with 5 additions and 4 deletions

View file

@ -140,7 +140,6 @@ define('MAX_LIKERS', 75);
* Email notification options
* @{
*/
define('NOTIFY_SHARE', 1024);
define('NOTIFY_SYSTEM', 32768);
/* @}*/

View file

@ -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\Type::TAG_SELF, Notify\Type::COMMENT, NOTIFY_SHARE],
$condition = ['type' => [Notify\Type::TAG_SELF, Notify\Type::COMMENT, Notify\Type::SHARE],
'link' => $params['link'], 'uid' => $params['uid']];
if (DBA::exists('notify', $condition)) {
return false;
@ -227,7 +227,7 @@ function notification($params)
$itemlink = $params['link'];
}
if ($params['type'] == NOTIFY_SHARE) {
if ($params['type'] == Notify\Type::SHARE) {
$subject = $l10n->t('[Friendica:Notify] %s shared a new post', $params['source_name']);
$preamble = $l10n->t('%1$s shared a new post at %2$s', $params['source_name'], $sitename);
@ -589,7 +589,7 @@ function check_item_notification($itemid, $uid, $notification_type) {
}
if ($notification_type & UserItem::NOTIF_SHARED) {
$params['type'] = NOTIFY_SHARE;
$params['type'] = Notify\Type::SHARE;
$params['verb'] = Activity::POST;
} elseif ($notification_type & UserItem::NOTIF_EXPLICIT_TAGGED) {
$params['type'] = Notify\Type::TAG_SELF;

View file

@ -31,4 +31,6 @@ class Type
const TAG_SHARE = 256;
/** @var int Notification about getting poked/prodded/etc. */
const POKE = 512;
/** @var int Notification about either a contact had posted something directly or the contact is a mentioned forum */
const SHARE = 1024;
}