]> git.mxchange.org Git - friendica-addons.git/blobdiff - libertree/libertree.php
Twitter, Statusnet: Supress profile link of user whose message was repeated
[friendica-addons.git] / libertree / libertree.php
index fc9dcc44d0b6af0823b505a1647bc6b28af5735e..c117fa811363765dc19174c2bf7b4594e5fdcec5 100755 (executable)
@@ -118,7 +118,7 @@ function libertree_post_local(&$a,&$b) {
        if($b['private'] || $b['parent'])
                return;
 
-    $ltree_post   = intval(get_pconfig(local_user(),'libertree','post'));
+       $ltree_post   = intval(get_pconfig(local_user(),'libertree','post'));
 
        $ltree_enable = (($ltree_post && x($_REQUEST,'libertree_enable')) ? intval($_REQUEST['libertree_enable']) : 0);
 
@@ -176,6 +176,12 @@ function libertree_send(&$a,&$b) {
                $body = str_ireplace("[quote", "\n\n[quote", $body);
                $body = str_ireplace("[/quote]", "[/quote]\n\n", $body);
 
+               // Removal of tags and mentions
+               // #-tags
+               $body = preg_replace('/#\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', '#$2', $body);
+               // @-mentions
+               $body = preg_replace('/@\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', '@$2', $body);
+
                // remove multiple newlines
                do {
                        $oldbody = $body;