aboutsummaryrefslogtreecommitdiffstats
path: root/mod/notify.php
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2014-06-24 19:34:36 +0200
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2014-06-24 19:34:36 +0200
commitb8dc9e855af2d30f33d0f90dc13d8cad0a7b3e70 (patch)
tree718df6305bcb82c8dcb4b287a7132422e748cdfb /mod/notify.php
parentc2d520f1be115fb3cb5da2a35eb10146cecee8aa (diff)
parenta92fb0b04c3e6474ec48faf8e4cc65c382e89d66 (diff)
downloadvolse-hubzilla-b8dc9e855af2d30f33d0f90dc13d8cad0a7b3e70.tar.gz
volse-hubzilla-b8dc9e855af2d30f33d0f90dc13d8cad0a7b3e70.tar.bz2
volse-hubzilla-b8dc9e855af2d30f33d0f90dc13d8cad0a7b3e70.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod/notify.php')
-rw-r--r--mod/notify.php19
1 files changed, 5 insertions, 14 deletions
diff --git a/mod/notify.php b/mod/notify.php
index dd26bfe7e..72534c7fd 100644
--- a/mod/notify.php
+++ b/mod/notify.php
@@ -10,27 +10,18 @@ function notify_init(&$a) {
intval(argv(2)),
intval(local_user())
);
- if(count($r)) {
- q("update notify set seen = 1 where ( link = '%s' or ( parent != 0 and parent = %d and otype = '%s' )) and uid = %d",
- dbesc($r[0]['link']),
- intval($r[0]['parent']),
+ if($r) {
+ q("update notify set seen = 1 where (( parent != '' and parent = '%s' and otype = '%s' ) or link = '%s' ) and uid = %d",
+ dbesc($r[0]['parent']),
dbesc($r[0]['otype']),
+ dbesc($r[0]['link']),
intval(local_user())
);
goaway($r[0]['link']);
}
-
goaway($a->get_baseurl(true));
}
- if(argc() > 2 && argv(1) === 'mark' && argv(2) === 'all' ) {
- $r = q("update notify set seen = 1 where uid = %d",
- intval(local_user())
- );
- $j = json_encode(array('result' => ($r) ? 'success' : 'fail'));
- echo $j;
- killme();
- }
}
@@ -48,7 +39,7 @@ function notify_content(&$a) {
intval(local_user())
);
- if (count($r) > 0) {
+ if($r) {
foreach ($r as $it) {
$notif_content .= replace_macros($not_tpl,array(
'$item_link' => $a->get_baseurl(true).'/notify/view/'. $it['id'],