]> git.mxchange.org Git - friendica.git/blobdiff - mod/ping.php
Merge branch 'newui' of github.com:fabrixxm/friendika into newui
[friendica.git] / mod / ping.php
index f9d7cd8a7a7db61f2d2f5c60b4ba17fbae22c37f..38a32744d05a7966e469d472d0015984d20555cf 100644 (file)
@@ -13,7 +13,7 @@ function ping_init(&$a) {
        $dislikes = array();
        $friends = array();
        
-       $r = q("SELECT `item`.`parent`, `item`.`verb`, `item`.`author-name`, 
+       $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`, 
                        `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, 
                        `pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink` 
                        FROM `item` INNER JOIN `item` as `pitem` ON  `pitem`.`id`=`item`.`parent`
@@ -35,12 +35,12 @@ function ping_init(&$a) {
                                $friends[] = $it;
                                break;
                        default:
-                               $comments[] = $it;
+                               if ($it['parent']!=$it['id']) $comments[] = $it;
                }
        }
 
 
-       $r = q("SELECT `item`.`parent`, `item`.`verb`, `item`.`author-name`, 
+       $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`, 
                        `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, 
                        `pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink` 
                        FROM `item` INNER JOIN `item` as `pitem` ON  `pitem`.`id`=`item`.`parent`
@@ -61,7 +61,7 @@ function ping_init(&$a) {
                                $friends[] = $it;
                                break;
                        default:
-                               $comments[] = $it;
+                               if ($it['parent']!=$it['id']) $comments[] = $it;
                }
        }
 
@@ -159,8 +159,26 @@ function ping_init(&$a) {
        }
 
 
-       echo "  </notif>
-               </result>
+       echo "  </notif>";
+       
+       echo " <sysmsgs>";
+               if(x($_SESSION,'sysmsg')){
+                       foreach ($_SESSION['sysmsg'] as $m){
+                               echo "<notice>".($m)."</notice>";
+                       }
+                       $_SESSION['sysmsg']=array();
+                       unset($_SESSION['sysmsg']);
+               }
+               if(x($_SESSION,'sysmsg_info')){
+                       foreach ($_SESSION['sysmsg_info'] as $m){
+                               echo "<info>".($m)."</info>";
+                       }
+                       $_SESSION['sysmsg_info']=array();
+                       unset($_SESSION['sysmsg_info']);
+               }
+       
+       echo " </sysmsgs>";
+       echo"</result>
        ";
 
        killme();