]> git.mxchange.org Git - friendica.git/blob - mod/notify.php
email notify now redirected through mod_notify, weirdness in local deliver caused...
[friendica.git] / mod / notify.php
1 <?php
2
3
4 function notify_init(&$a) {
5         if(! local_user())
6                 return;
7
8         if($a->argc > 2 && $a->argv[1] === 'view' && intval($a->argv[2])) {
9                 $r = q("select * from notify where id = %d and uid = %d limit 1",
10                         intval($a->argv[2]),
11                         intval(local_user())
12                 );
13                 if(count($r)) {
14                         q("update notify set seen = 1 where id = %d and uid = %d limit 1",
15                                 intval($a->argv[2]),
16                                 intval(local_user())
17                         );
18                         goaway($r[0]['link']);
19                 }
20
21                 goaway($a->get_baseurl());
22         }
23 }
24
25
26 function notify_content(&$a) {
27         if(! local_user())
28                 return login();
29 }