From: Tobias Diekershoff Date: Tue, 15 May 2012 09:23:39 +0000 (+0200) Subject: SN/T dont send linked @-names when we dont send linked #-tags X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=80f5c5bbe0f5363673413f14c585e200a434155d;p=friendica-addons.git SN/T dont send linked @-names when we dont send linked #-tags --- diff --git a/statusnet.tgz b/statusnet.tgz index c0831ee7..33fbc68a 100755 Binary files a/statusnet.tgz and b/statusnet.tgz differ diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 3b189932..dd876168 100755 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -342,7 +342,7 @@ function statusnet_settings(&$a,&$s) { $s .= ''; $s .= ''; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; @@ -453,7 +453,10 @@ function statusnet_post_hook(&$a,&$b) { // that is, don't send if the option is not set in the // connector settings if ($linksenabled=='0') { + // #-tags $tmp = preg_replace( '/#\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', '#$2', $tmp); + // @-mentions + $tmp = preg_replace( '/@\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', '@$2', $tmp); } // preserve links to webpages $tmp = preg_replace( '/\[url\=(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)\](\w+.*?)\[\/url\]/i', '$2 $1', $tmp); diff --git a/twitter.tgz b/twitter.tgz index a1b22f6e..e011308e 100755 Binary files a/twitter.tgz and b/twitter.tgz differ diff --git a/twitter/twitter.php b/twitter/twitter.php index 05c9cf91..0ac9396d 100755 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -198,7 +198,7 @@ function twitter_settings(&$a,&$s) { $s .= ''; $s .= ''; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; @@ -319,7 +319,10 @@ function twitter_post_hook(&$a,&$b) { // that is, don't send if the option is not set in the // connector settings if ($linksenabled=='0') { + // #-tags $tmp = preg_replace( '/#\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', '#$2', $tmp); + // @-mentions + $tmp = preg_replace( '/@\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', '@$2', $tmp); } $tmp = preg_replace( '/\[url\=(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)\](\w+.*?)\[\/url\]/i', '$2 $1', $tmp); $tmp = preg_replace( '/\[bookmark\=(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)\](\w+.*?)\[\/bookmark\]/i', '$2 $1', $tmp);