* Email notification options
* @{
*/
-define('NOTIFY_MAIL', 16);
define('NOTIFY_SUGGEST', 32);
define('NOTIFY_PROFILE', 64);
define('NOTIFY_TAGSELF', 128);
$hsitelink = '';
$itemlink = '';
- if ($params['type'] == NOTIFY_MAIL) {
+ if ($params['type'] == Notify\Type::MAIL) {
$itemlink = $siteurl.'/message/'.$params['item']['id'];
$params["link"] = $itemlink;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Mail;
+use Friendica\Model\Notify\Type;
use Friendica\Module\Security\Login;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Proxy as ProxyUtils;
if ($message['convid']) {
// 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
- 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 {
$messages = false;
}
AND $seensql `notify`.`seen` ORDER BY `notify`.`date` $order LIMIT %d, 50",
intval($uid),
intval(Type::INTRO),
- intval(NOTIFY_MAIL),
+ intval(Type::MAIL),
intval($offset)
);
'$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, ''],
'$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, ''],
'$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, ''],
use Friendica\Core\Worker;
use Friendica\DI;
use Friendica\Database\DBA;
+use Friendica\Model\Notify\Type;
use Friendica\Network\Probe;
use Friendica\Protocol\Activity;
use Friendica\Util\DateTimeFormat;
// send notifications.
$notif_params = [
- 'type' => NOTIFY_MAIL,
+ 'type' => Type::MAIL,
'notify_flags' => $user['notify-flags'],
'language' => $user['language'],
'to_name' => $user['username'],
const WALL = 4;
/** @var int Notification about a followup comment */
const COMMENT = 8;
+ /** @var int Notification about a private message */
+ const MAIL = 16;
}
$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'];
$notifications = DBA::count('notify', $condition, $params);