X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fnotify.php;h=02260514af91493b287a06438fd799e016c224e5;hb=8944ad1ac1bb4293eeacd79536cdeed3173cad9a;hp=ae8273a1d3eda064c7a7b2f5697162e3955f018c;hpb=ea4be0db89b5e95b50211e023e94aa008aadae46;p=friendica.git diff --git a/mod/notify.php b/mod/notify.php index ae8273a1d3..02260514af 100644 --- a/mod/notify.php +++ b/mod/notify.php @@ -17,6 +17,17 @@ function notify_init(&$a) { dbesc($r[0]['otype']), intval(local_user()) ); + + // The friendica client has problems with the GUID. this is some workaround + if ($a->is_friendica_app()) { + 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 +51,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,8 +71,8 @@ function notify_content(&$a) { } else { $notif_content .= t('No more system notifications.'); } - - $o .= replace_macros($notif_tpl,array( + + $o .= replace_macros($notif_tpl, array( '$notif_header' => t('System Notifications'), '$tabs' => '', // $tabs, '$notif_content' => $notif_content, @@ -70,4 +81,4 @@ function notify_content(&$a) { return $o; -} \ No newline at end of file +}