]> git.mxchange.org Git - friendica.git/commitdiff
Merge branch 'develop' of github.com:annando/friendica into 1410-remote-self
authorMichael Vogel <icarus@dabo.de>
Mon, 27 Oct 2014 10:45:39 +0000 (11:45 +0100)
committerMichael Vogel <icarus@dabo.de>
Mon, 27 Oct 2014 10:45:39 +0000 (11:45 +0100)
1  2 
include/items.php

diff --combined include/items.php
index 1107553e85bb9cc25abdba81a60018eec34e04e5,53e8126a40df6eddd00f276530ea477d6b1b005c..0a0d7f5dce128a67bb46cfcebe68a433fd267f70
@@@ -872,7 -872,7 +872,7 @@@ function get_atom_elements($feed, $item
        }
  
        if (isset($contact["network"]) AND ($contact["network"] == NETWORK_FEED) AND $contact['fetch_further_information']) {
-               $res["body"] = $res["title"].add_page_info($res['plink'], false, "", true);
+               $res["body"] = $res["title"].add_page_info($res['plink'], false, "", ($contact['fetch_further_information'] == 2));
                $res["title"] = "";
                $res["object-type"] = ACTIVITY_OBJ_BOOKMARK;
        } elseif (isset($contact["network"]) AND ($contact["network"] == NETWORK_OSTATUS))
        return $res;
  }
  
- function add_page_info($url, $no_photos = false, $photo = "", $keywords = false) {
-       require_once("mod/parse_url.php");
-       $data = parseurl_getsiteinfo($url, true);
-       logger('add_page_info: fetch page info for '.$url.' '.print_r($data, true), LOGGER_DEBUG);
+ function add_page_info_data($data) {
+       call_hooks('page_info_data', $data);
  
        // It maybe is a rich content, but if it does have everything that a link has,
        // then treat it that way
                $text .= "[quote]".$data["text"]."[/quote]";
  
        $hashtags = "";
-       if ($keywords AND isset($data["keywords"])) {
+       if (isset($data["keywords"]) AND count($data["keywords"])) {
                $a = get_app();
                $hashtags = "\n";
                foreach ($data["keywords"] AS $keyword) {
        return("\n[class=type-".$data["type"]."]".$text."[/class]".$hashtags);
  }
  
+ function add_page_info($url, $no_photos = false, $photo = "", $keywords = false) {
+       require_once("mod/parse_url.php");
+       $data = parseurl_getsiteinfo($url, true);
+       logger('add_page_info: fetch page info for '.$url.' '.print_r($data, true), LOGGER_DEBUG);
+       if (!$keywords AND isset($data["keywords"]))
+               unset($data["keywords"]);
+       $text = add_page_info_data($data);
+       return($text);
+ }
  function add_page_info_to_body($body, $texturl = false, $no_photos = false) {
  
        logger('add_page_info_to_body: fetch page info for body '.$body, LOGGER_DEBUG);
@@@ -2589,9 -2600,7 +2600,9 @@@ function consume_feed($xml,$importer,&$
                                // Turn this into a wall post.
  
                                if($contact['remote_self']) {
 -                                      if ($contact['remote_self'] == 2) {
 +                                      if ($contact['remote_self'] == 1)
 +                                              $notify = (normalise_link($datarray['author-link']) == normalise_link($datarray['owner-link']));
 +                                      elseif ($contact['remote_self'] == 2) {
                                                $r = q("SELECT `id`,`url`,`name`,`photo`,`network` FROM `contact` WHERE `uid` = %d AND `self`", intval($importer['uid']));
                                                if (count($r)) {
                                                        $datarray['contact-id'] = $r[0]["id"];
                                                        $datarray['author-link']   = $datarray['owner-link'];
                                                        $datarray['author-avatar'] = $datarray['owner-avatar'];
                                                }
 +                                              $notify = true;
                                        }
  
                                        if (!isset($datarray["app"]) OR ($datarray["app"] == ""))
                                                $datarray["app"] = network_to_name($contact['network']);
  
 -                                      $notify = true;
 -                                      if($contact['network'] === NETWORK_FEED) {
 +                                      if ($contact['network'] === NETWORK_FEED)
                                                $datarray['private'] = 0;
 +                                      elseif ($contact['network'] === NETWORK_DFRN) {
 +                                              // To-Do: Neue GUID oder sowas
                                        }
                                } else
                                        $notify = false;