]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
modified: view/theme/smoothly/style.css
[friendica.git] / include / items.php
index 46eafdc25b31be1d336c27da679937474d45308b..8bd28f788de36643c0c56ac2f92bdd98be494105 100755 (executable)
@@ -835,14 +835,16 @@ function get_atom_elements($feed,$item) {
        // Search for ostatus conversation url
        $links = $item->feed->data["child"][SIMPLEPIE_NAMESPACE_ATOM_10]["feed"][0]["child"][SIMPLEPIE_NAMESPACE_ATOM_10]["entry"][0]["child"]["http://www.w3.org/2005/Atom"]["link"];
 
-       foreach ($links as $link) {
-               $conversation = array_shift($link["attribs"]);
+       if (is_array($links)) {
+               foreach ($links as $link) {
+                       $conversation = array_shift($link["attribs"]);
 
-               if ($conversation["rel"] == "ostatus:conversation") {
-                       $res["ostatus_conversation"] = $conversation["href"];
-                       logger('get_atom_elements: found conversation url '.$res["ostatus_conversation"]);
-               }
-       };
+                       if ($conversation["rel"] == "ostatus:conversation") {
+                               $res["ostatus_conversation"] = $conversation["href"];
+                               logger('get_atom_elements: found conversation url '.$res["ostatus_conversation"]);
+                       }
+               };
+       }
 
        $arr = array('feed' => $feed, 'item' => $item, 'result' => $res);
 
@@ -1147,7 +1149,6 @@ function item_store($arr,$force_parent = false) {
         $arr['deny_gid'] = $deny_gid;
         $arr['private'] = $private;
         $arr['deleted'] = $parent_deleted;
-       call_hooks('post_remote_end',$arr);
 
        // update the commented timestamp on the parent
 
@@ -1193,6 +1194,14 @@ function item_store($arr,$force_parent = false) {
                logger('item_store: put item '.$current_post.' into cachefile '.$cachefile);
        }
 
+        $r = q('SELECT * FROM `item` WHERE id = %d', intval($current_post));
+        if (count($r) == 1) {
+            call_hooks('post_remote_end', $r[0]);
+        }
+        else {
+            logger('item_store: new item not found in DB, id ' . $current_post);
+        }
+
        return $current_post;
 }
 
@@ -3642,9 +3651,13 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) {
 }
 
 function fix_private_photos($s, $uid, $item = null, $cid = 0) {
+
+       if(get_config('system','disable_embedded'))
+               return $s;
+
        $a = get_app();
 
-       logger('fix_private_photos', LOGGER_DEBUG);
+       logger('fix_private_photos: check for photos', LOGGER_DEBUG);
        $site = substr($a->get_baseurl(),strpos($a->get_baseurl(),'://'));
 
        $orig_body = $s;