Merge branch 'develop' of git://github.com/friendica/friendica into develop

This commit is contained in:
rebeka-catalina 2017-04-08 14:50:45 +02:00
commit fa76ec4e33
3 changed files with 14 additions and 7 deletions

View file

@ -200,7 +200,6 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) {
if ($item["plink"] == "") { if ($item["plink"] == "") {
$item["plink"] = $xpath->evaluate('rss:link/text()', $entry)->item(0)->nodeValue; $item["plink"] = $xpath->evaluate('rss:link/text()', $entry)->item(0)->nodeValue;
} }
$item["plink"] = original_url($item["plink"]);
$item["uri"] = $xpath->evaluate('atom:id/text()', $entry)->item(0)->nodeValue; $item["uri"] = $xpath->evaluate('atom:id/text()', $entry)->item(0)->nodeValue;
@ -210,12 +209,17 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) {
if ($item["uri"] == "") { if ($item["uri"] == "") {
$item["uri"] = $item["plink"]; $item["uri"] = $item["plink"];
} }
$orig_plink = $item["plink"];
$item["plink"] = original_url($item["plink"]);
$item["parent-uri"] = $item["uri"]; $item["parent-uri"] = $item["uri"];
if (!$simulate) { if (!$simulate) {
$r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s' AND `network` IN ('%s', '%s')", $r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s' AND `network` IN ('%s', '%s')",
intval($importer["uid"]), dbesc($item["uri"]), dbesc(NETWORK_FEED), dbesc(NETWORK_DFRN)); intval($importer["uid"]), dbesc($item["uri"]), dbesc(NETWORK_FEED), dbesc(NETWORK_DFRN));
if ($r) { if (dbm::is_result($r)) {
logger("Item with uri ".$item["uri"]." for user ".$importer["uid"]." already existed under id ".$r[0]["id"], LOGGER_DEBUG); logger("Item with uri ".$item["uri"]." for user ".$importer["uid"]." already existed under id ".$r[0]["id"], LOGGER_DEBUG);
continue; continue;
} }
@ -340,6 +344,7 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) {
// Distributed items should have a well formatted URI. // Distributed items should have a well formatted URI.
// Additionally we have to avoid conflicts with identical URI between imported feeds and these items. // Additionally we have to avoid conflicts with identical URI between imported feeds and these items.
if ($notify) { if ($notify) {
$item['guid'] = uri_to_guid($orig_plink, $a->get_hostname());
unset($item['uri']); unset($item['uri']);
unset($item['parent-uri']); unset($item['parent-uri']);
} }

View file

@ -407,10 +407,12 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
// We have to avoid duplicates. So we create the GUID in form of a hash of the plink or uri. // We have to avoid duplicates. So we create the GUID in form of a hash of the plink or uri.
// In difference to the call to "uri_to_guid" several lines below we add the hash of our own host. // In difference to the call to "uri_to_guid" several lines below we add the hash of our own host.
// This is done because our host is the original creator of the post. // This is done because our host is the original creator of the post.
if (isset($arr['plink'])) { if (!isset($arr['guid'])) {
$arr['guid'] = uri_to_guid($arr['plink'], $a->get_hostname()); if (isset($arr['plink'])) {
} elseif (isset($arr['uri'])) { $arr['guid'] = uri_to_guid($arr['plink'], $a->get_hostname());
$arr['guid'] = uri_to_guid($arr['uri'], $a->get_hostname()); } elseif (isset($arr['uri'])) {
$arr['guid'] = uri_to_guid($arr['uri'], $a->get_hostname());
}
} }
} }

View file

@ -440,7 +440,7 @@ nav.navbar .nav>li>a:focus{
border-radius: 3px; border-radius: 3px;
} }
#topbar-first .nav>.account .dropdown-toggle { #topbar-first .nav>.account .dropdown-toggle {
padding: 10px 5px 8px; padding: 10px 5px 0px;
line-height: 1.1em; line-height: 1.1em;
text-align: left text-align: left
} }