]> git.mxchange.org Git - friendica.git/blobdiff - mod/notify.php
use noscrape by default, add opt-out option to disable it
[friendica.git] / mod / notify.php
index b4d60a747c0bb5fcf871f9775c8fb8b909e5932c..f9c5a09b277deeae503998f895ce3650100dd03d 100644 (file)
@@ -17,6 +17,20 @@ function notify_init(&$a) {
                                dbesc($r[0]['otype']),
                                intval(local_user())
                        );
+
+                       // Friendica-Client
+                       $friendicamobile = ($_SERVER['HTTP_USER_AGENT'] == "Apache-HttpClient/UNAVAILABLE (java 1.4)");
+
+                       // The friendica client has problems with the GUID. this is some workaround
+                       if ($friendicamobile) {
+                               require_once("include/items.php");
+                               $urldata = parse_url($r[0]['link']);
+                               $guid = basename($urldata["path"]);
+                               $itemdata = get_item_id($guid, local_user());
+                               if ($itemdata["id"] != 0)
+                                       $r[0]['link'] = $a->get_baseurl().'/display/'.$itemdata["nick"].'/'.$itemdata["id"];
+                       }
+
                        goaway($r[0]['link']);
                }
 
@@ -40,14 +54,14 @@ function notify_content(&$a) {
                return login();
 
                $notif_tpl = get_markup_template('notifications.tpl');
-               
+
                $not_tpl = get_markup_template('notify.tpl');
                require_once('include/bbcode.php');
 
                $r = q("SELECT * from notify where uid = %d and seen = 0 order by date desc",
                        intval(local_user())
                );
-               
+
                if (count($r) > 0) {
                        foreach ($r as $it) {
                                $notif_content .= replace_macros($not_tpl,array(
@@ -60,7 +74,7 @@ function notify_content(&$a) {
                } else {
                        $notif_content .= t('No more system notifications.');
                }
-               
+
                $o .= replace_macros($notif_tpl, array(
                        '$notif_header' => t('System Notifications'),
                        '$tabs' => '', // $tabs,