Move Notify::TYPE_MAIL
This commit is contained in:
parent
e6fb044e60
commit
9435cc4b88
1
boot.php
1
boot.php
|
@ -140,7 +140,6 @@ define('MAX_LIKERS', 75);
|
||||||
* Email notification options
|
* Email notification options
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
define('NOTIFY_MAIL', 16);
|
|
||||||
define('NOTIFY_SUGGEST', 32);
|
define('NOTIFY_SUGGEST', 32);
|
||||||
define('NOTIFY_PROFILE', 64);
|
define('NOTIFY_PROFILE', 64);
|
||||||
define('NOTIFY_TAGSELF', 128);
|
define('NOTIFY_TAGSELF', 128);
|
||||||
|
|
|
@ -102,7 +102,7 @@ function notification($params)
|
||||||
$hsitelink = '';
|
$hsitelink = '';
|
||||||
$itemlink = '';
|
$itemlink = '';
|
||||||
|
|
||||||
if ($params['type'] == NOTIFY_MAIL) {
|
if ($params['type'] == Notify\Type::MAIL) {
|
||||||
$itemlink = $siteurl.'/message/'.$params['item']['id'];
|
$itemlink = $siteurl.'/message/'.$params['item']['id'];
|
||||||
$params["link"] = $itemlink;
|
$params["link"] = $itemlink;
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Mail;
|
use Friendica\Model\Mail;
|
||||||
|
use Friendica\Model\Notify\Type;
|
||||||
use Friendica\Module\Security\Login;
|
use Friendica\Module\Security\Login;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
use Friendica\Util\Proxy as ProxyUtils;
|
use Friendica\Util\Proxy as ProxyUtils;
|
||||||
|
@ -338,10 +339,10 @@ function message_content(App $a)
|
||||||
|
|
||||||
if ($message['convid']) {
|
if ($message['convid']) {
|
||||||
// Clear Diaspora private message notifications
|
// Clear Diaspora private message notifications
|
||||||
DBA::update('notify', ['seen' => 1], ['type' => NOTIFY_MAIL, 'parent' => $message['convid'], 'uid' => local_user()]);
|
DBA::update('notify', ['seen' => 1], ['type' => Type::MAIL, 'parent' => $message['convid'], 'uid' => local_user()]);
|
||||||
}
|
}
|
||||||
// Clear DFRN private message notifications
|
// Clear DFRN private message notifications
|
||||||
DBA::update('notify', ['seen' => 1], ['type' => NOTIFY_MAIL, 'parent' => $message['parent-uri'], 'uid' => local_user()]);
|
DBA::update('notify', ['seen' => 1], ['type' => Type::MAIL, 'parent' => $message['parent-uri'], 'uid' => local_user()]);
|
||||||
} else {
|
} else {
|
||||||
$messages = false;
|
$messages = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -405,7 +405,7 @@ function ping_get_notifications($uid)
|
||||||
AND $seensql `notify`.`seen` ORDER BY `notify`.`date` $order LIMIT %d, 50",
|
AND $seensql `notify`.`seen` ORDER BY `notify`.`date` $order LIMIT %d, 50",
|
||||||
intval($uid),
|
intval($uid),
|
||||||
intval(Type::INTRO),
|
intval(Type::INTRO),
|
||||||
intval(NOTIFY_MAIL),
|
intval(Type::MAIL),
|
||||||
intval($offset)
|
intval($offset)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1234,7 +1234,7 @@ function settings_content(App $a)
|
||||||
'$notify2' => ['notify2', DI::l10n()->t('Your introductions are confirmed'), ($notify & Type::CONFIRM), Type::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 & Type::WALL), Type::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 & 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 & NOTIFY_MAIL), NOTIFY_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 & NOTIFY_SUGGEST), NOTIFY_SUGGEST, ''],
|
'$notify6' => ['notify6', DI::l10n()->t('You receive a friend suggestion'), ($notify & NOTIFY_SUGGEST), NOTIFY_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 & NOTIFY_TAGSELF), NOTIFY_TAGSELF, ''],
|
||||||
'$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, ''],
|
||||||
|
|
|
@ -10,6 +10,7 @@ use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
use Friendica\Model\Notify\Type;
|
||||||
use Friendica\Network\Probe;
|
use Friendica\Network\Probe;
|
||||||
use Friendica\Protocol\Activity;
|
use Friendica\Protocol\Activity;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
|
@ -68,7 +69,7 @@ class Mail
|
||||||
|
|
||||||
// send notifications.
|
// send notifications.
|
||||||
$notif_params = [
|
$notif_params = [
|
||||||
'type' => NOTIFY_MAIL,
|
'type' => Type::MAIL,
|
||||||
'notify_flags' => $user['notify-flags'],
|
'notify_flags' => $user['notify-flags'],
|
||||||
'language' => $user['language'],
|
'language' => $user['language'],
|
||||||
'to_name' => $user['username'],
|
'to_name' => $user['username'],
|
||||||
|
|
|
@ -15,4 +15,6 @@ class Type
|
||||||
const WALL = 4;
|
const WALL = 4;
|
||||||
/** @var int Notification about a followup comment */
|
/** @var int Notification about a followup comment */
|
||||||
const COMMENT = 8;
|
const COMMENT = 8;
|
||||||
|
/** @var int Notification about a private message */
|
||||||
|
const MAIL = 16;
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ class Delegation extends BaseModule
|
||||||
|
|
||||||
$identities[$key]['selected'] = ($identity['nickname'] === DI::app()->user['nickname']);
|
$identities[$key]['selected'] = ($identity['nickname'] === DI::app()->user['nickname']);
|
||||||
|
|
||||||
$condition = ["`uid` = ? AND `msg` != '' AND NOT (`type` IN (?, ?)) AND NOT `seen`", $identity['uid'], Type::INTRO, NOTIFY_MAIL];
|
$condition = ["`uid` = ? AND `msg` != '' AND NOT (`type` IN (?, ?)) AND NOT `seen`", $identity['uid'], Type::INTRO, Type::MAIL];
|
||||||
$params = ['distinct' => true, 'expression' => 'parent'];
|
$params = ['distinct' => true, 'expression' => 'parent'];
|
||||||
$notifications = DBA::count('notify', $condition, $params);
|
$notifications = DBA::count('notify', $condition, $params);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue