]> git.mxchange.org Git - friendica.git/blobdiff - include/diaspora.php
Added some more timestamp measuring
[friendica.git] / include / diaspora.php
index a0d1fcd751ea114895e87f39d39e01f8c5ed310c..1202a3a5521bbc54fae0d0749020deaaac9012a0 100755 (executable)
@@ -833,31 +833,6 @@ function diaspora_post($importer,$xml,$msg) {
 
        $str_tags = '';
 
-       $tags = get_tags($body);
-
-       if(count($tags)) {
-               foreach($tags as $tag) {
-                       if(strpos($tag,'#') === 0) {
-                               if(strpos($tag,'[url='))
-                                       continue;
-
-                               // don't link tags that are already embedded in links
-
-                               if(preg_match('/\[(.*?)' . preg_quote($tag,'/') . '(.*?)\]/',$body))
-                                       continue;
-                               if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag,'/') . '(.*?)\)/',$body))
-                                       continue;
-
-                               $basetag = str_replace('_',' ',substr($tag,1));
-                               $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
-                               if(strlen($str_tags))
-                                       $str_tags .= ',';
-                               $str_tags .= '#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
-                               continue;
-                       }
-               }
-       }
-
        $cnt = preg_match_all('/@\[url=(.*?)\[\/url\]/ism',$body,$matches,PREG_SET_ORDER);
        if($cnt) {
                foreach($matches as $mtch) {
@@ -1054,34 +1029,8 @@ function diaspora_fetch_message($guid, $server, $level = 0) {
                return false;
 
        $item["tag"] = '';
-
-       $tags = get_tags($body);
-
-       if(count($tags)) {
-               foreach($tags as $tag) {
-                       if(strpos($tag,'#') === 0) {
-                               if(strpos($tag,'[url='))
-                                       continue;
-
-                               // don't link tags that are already embedded in links
-
-                               if(preg_match('/\[(.*?)' . preg_quote($tag,'/') . '(.*?)\]/',$body))
-                                       continue;
-                               if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag,'/') . '(.*?)\)/',$body))
-                                       continue;
-
-
-                               $basetag = str_replace('_',' ',substr($tag,1));
-                               $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
-                               if(strlen($item["tag"]))
-                                       $item["tag"] .= ',';
-                               $item["tag"] .= '#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
-                               continue;
-                       }
-               }
-       }
-
        $item["body"] = $body;
+
        return $item;
 }
 
@@ -1218,6 +1167,8 @@ function diaspora_reshare($importer,$xml,$msg) {
                $prefix = "[share author='".str_replace(array("'", "[", "]"), array("'", "[", "]"),$person['name']).
                                "' profile='".$person['url'].
                                "' avatar='".((x($person,'thumb')) ? $person['thumb'] : $person['photo']).
+                               "' guid='".$orig_guid.
+                               "' posted='".$orig_created.
                                "' link='".str_replace(array("'", "[", "]"), array("'", "[", "]"),$orig_url)."']";
                $datarray['author-name'] = $contact['name'];
                $datarray['author-link'] = $contact['url'];
@@ -1481,34 +1432,6 @@ function diaspora_comment($importer,$xml,$msg) {
 
        $datarray = array();
 
-       $str_tags = '';
-
-       $tags = get_tags($body);
-
-       if(count($tags)) {
-               foreach($tags as $tag) {
-                       if(strpos($tag,'#') === 0) {
-                               if(strpos($tag,'[url='))
-                                       continue;
-
-                               // don't link tags that are already embedded in links
-
-                               if(preg_match('/\[(.*?)' . preg_quote($tag,'/') . '(.*?)\]/',$body))
-                                       continue;
-                               if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag,'/') . '(.*?)\)/',$body))
-                                       continue;
-
-
-                               $basetag = str_replace('_',' ',substr($tag,1));
-                               $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
-                               if(strlen($str_tags))
-                                       $str_tags .= ',';
-                               $str_tags .= '#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
-                               continue;
-                       }
-               }
-       }
-
        $datarray['uid'] = $importer['uid'];
        $datarray['contact-id'] = $contact['id'];
        $datarray['type'] = 'remote-comment';
@@ -1532,7 +1455,6 @@ function diaspora_comment($importer,$xml,$msg) {
        $datarray['author-link'] = $person['url'];
        $datarray['author-avatar'] = ((x($person,'thumb')) ? $person['thumb'] : $person['photo']);
        $datarray['body'] = $body;
-       $datarray['tag'] = $str_tags;
 
        // We can't be certain what the original app is if the message is relayed.
        if(($parent_item['origin']) && (! $parent_author_signature))