From: Michael Vogel Date: Fri, 24 Apr 2015 22:50:48 +0000 (+0200) Subject: Don't generate a preview in an item from Diaspora if it is a posting from red matrix. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=20fc0e52851e121ec47eabc5f788116a6e1a74da;p=friendica.git Don't generate a preview in an item from Diaspora if it is a posting from red matrix. --- diff --git a/include/diaspora.php b/include/diaspora.php index 689f5765b3..a6e341729c 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -779,6 +779,10 @@ function diaspora_post_allow($importer,$contact) { return false; } +function diaspora_is_redmatrix($url) { + return(strstr($url, "/channel/")); +} + function diaspora_plink($addr, $guid) { $r = q("SELECT `url`, `nick` FROM `fcontact` WHERE `addr`='%s' LIMIT 1", $addr); @@ -786,7 +790,7 @@ function diaspora_plink($addr, $guid) { if (!$r) return 'https://'.substr($addr,strpos($addr,'@')+1).'/posts/'.$guid; - if (strstr($r[0]["url"], "/channel/")) + if (diaspora_is_redmatrix($r[0]["url"])) return $r[0]["url"]."/?f=&mid=".$guid; return 'https://'.substr($addr,strpos($addr,'@')+1).'/posts/'.$guid; @@ -841,7 +845,8 @@ function diaspora_post($importer,$xml,$msg) { $body = diaspora2bb($xml->raw_message); // Add OEmbed and other information to the body - $body = add_page_info_to_body($body, false, true); + if (!diaspora_is_redmatrix($contact['url'])) + $body = add_page_info_to_body($body, false, true); $datarray = array();