aboutsummaryrefslogtreecommitdiffstats
path: root/include/enotify.php
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2014-12-31 10:21:38 +1100
committerRedMatrix <info@friendica.com>2014-12-31 10:21:38 +1100
commit4a82967639e662821de177e3bd829b735b4eb24e (patch)
tree0fd82236b54cfc90083ac0a2e2bf0a3a56fc7b18 /include/enotify.php
parent43671a0a323afa758df56c06822ce3c46da026df (diff)
parente6a3ea2c95579a33a5c009aa223a899c8f2aeeb8 (diff)
downloadvolse-hubzilla-4a82967639e662821de177e3bd829b735b4eb24e.tar.gz
volse-hubzilla-4a82967639e662821de177e3bd829b735b4eb24e.tar.bz2
volse-hubzilla-4a82967639e662821de177e3bd829b735b4eb24e.zip
Merge pull request #791 from pafcu/notifications
Improved notifications
Diffstat (limited to 'include/enotify.php')
-rw-r--r--include/enotify.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/include/enotify.php b/include/enotify.php
index f3eb80117..3fef3ba0a 100644
--- a/include/enotify.php
+++ b/include/enotify.php
@@ -357,9 +357,21 @@ function notification($params) {
// create notification entry in DB
+ $seen = 0;
+
+ // Mark some notifications as seen right away
+ // Note! The notification have to be created, because they are used to send emails
+ // So easiest solution to hide them from Notices is to mark them as seen right away.
+ // Another option would be to not add them to the DB, and change how emails are handled (probably would be better that way)
+ $always_show_in_notices = get_pconfig($recip['channel_id'],'system','always_show_in_notices');
+ if(!$always_show_in_notices) {
+ if(($params['type'] == NOTIFY_WALL) || ($params['type'] == NOTIFY_MAIL) || ($params['type'] == NOTIFY_INTRO)) {
+ $seen = 1;
+ }
+ }
- $r = q("insert into notify (hash,name,url,photo,date,aid,uid,link,parent,type,verb,otype)
- values('%s','%s','%s','%s','%s',%d,%d,'%s','%s',%d,'%s','%s')",
+ $r = q("insert into notify (hash,name,url,photo,date,aid,uid,link,parent,seen,type,verb,otype)
+ values('%s','%s','%s','%s','%s',%d,%d,'%s','%s',%d,%d,'%s','%s')",
dbesc($datarray['hash']),
dbesc($datarray['name']),
dbesc($datarray['url']),
@@ -369,6 +381,7 @@ function notification($params) {
intval($datarray['uid']),
dbesc($datarray['link']),
dbesc($datarray['parent']),
+ intval($seen),
intval($datarray['type']),
dbesc($datarray['verb']),
dbesc($datarray['otype'])