X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=statusnet%2Fstatusnet.php;h=dd8761680f365f99a186b832a8f2fd78af401e1f;hb=dafbc42bf4c0d09c4c458830500fff458ca2906b;hp=469b3ab89e9d4ee44c9884be6b7407ee1deed24d;hpb=28c5e4615ecfa069cc579bd86d4d26453a835914;p=friendica-addons.git diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 469b3ab8..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); @@ -489,9 +492,14 @@ function statusnet_post_hook(&$a,&$b) { $msg = implode(' ', $e); $msg .= '... ' . $shortlink; } - // and now tweet it :-) - if(strlen($msg)) - $dent->post('statuses/update', array('status' => $msg)); + // and now dent it :-) + if(strlen($msg)) { + $result = $dent->post('statuses/update', array('status' => $msg)); + logger('statusnet_post send, result: ' . print_r($result, true), LOGGER_DEBUG); + if ($result->error) { + logger('Send to StatusNet failed: "' . $result->error . '"'); + } + } } }