]> git.mxchange.org Git - friendica-addons.git/blobdiff - statusnet/statusnet.php
Merge branch 'apull'
[friendica-addons.git] / statusnet / statusnet.php
old mode 100644 (file)
new mode 100755 (executable)
index c29ea2e..7e9226a
@@ -5,7 +5,7 @@
  * Author: Tobias Diekershoff <https://diekershoff.homeunix.net/friendika/profile/tobias>
  */
  
-/*   StatusNet Plugin for Friendika
+/*   StatusNet Plugin for Friendica
  *
  *   Author: Tobias Diekershoff
  *           tobias.diekershoff@gmx.net
@@ -56,14 +56,13 @@ class StatusNetOAuth extends TwitterOAuth {
    *
    * @return API results
    *
-   * Copied here from the twitteroauth library and complemented by applying the proxy settings of friendika
+   * Copied here from the twitteroauth library and complemented by applying the proxy settings of friendica
    */
   function http($url, $method, $postfields = NULL) {
     $this->http_info = array();
     $ci = curl_init();
     /* Curl settings */
     $prx = get_config('system','proxy');
-    logger('Proxy SN: '.$prx);
     if(strlen($prx)) {
         curl_setopt($ci, CURLOPT_HTTPPROXYTUNNEL, 1);
         curl_setopt($ci, CURLOPT_PROXY, $prx);
@@ -215,7 +214,6 @@ function statusnet_settings_post ($a,$post) {
             } else {
                if (isset($_POST['statusnet-pin'])) {
                        //  if the user supplied us with a PIN from Twitter, let the magic of OAuth happen
-                       logger('got a StatusNet security code');
                     $api     = get_pconfig(local_user(), 'statusnet', 'baseapi');
                                        $ckey    = get_pconfig(local_user(), 'statusnet', 'consumerkey'  );
                                        $csecret = get_pconfig(local_user(), 'statusnet', 'consumersecret' );
@@ -282,7 +280,7 @@ function statusnet_settings(&$a,&$s) {
                 $s .= '<div class="settings-submit-wrapper" ><input type="submit" name="statusnet-submit" class="settings-submit" value="' . t('Submit') . '" /></div>';
             }
             $s .= '<h4>' . t('Provide your own OAuth Credentials') . '</h4>';
-            $s .= '<p>'. t('No consumer key pair for StatusNet found. Register your Friendika Account as an desktop client on your StatusNet account, copy the consumer key pair here and enter the API base root.<br />Before you register your own OAuth key pair ask the administrator if there is already a key pair for this Friendika installation at your favorited StatusNet installation.') .'</p>';
+            $s .= '<p>'. t('No consumer key pair for StatusNet found. Register your Friendica Account as an desktop client on your StatusNet account, copy the consumer key pair here and enter the API base root.<br />Before you register your own OAuth key pair ask the administrator if there is already a key pair for this Friendica installation at your favorited StatusNet installation.') .'</p>';
             $s .= '<div id="statusnet-consumer-wrapper">';
             $s .= '<label id="statusnet-consumerkey-label" for="statusnet-consumerkey">'. t('OAuth Consumer Key') .'</label>';
             $s .= '<input id="statusnet-consumerkey" type="text" name="statusnet-consumerkey" size="35" /><br />';
@@ -389,9 +387,6 @@ function statusnet_post_hook(&$a,&$b) {
        if(! strstr($b['postopts'],'statusnet'))
                return;
 
-       logger('StatusNet post invoked');
-
-
        load_pconfig($b['uid'], 'statusnet');
             
        $api     = get_pconfig($b['uid'], 'statusnet', 'baseapi');
@@ -408,7 +403,7 @@ function statusnet_post_hook(&$a,&$b) {
                $msg = strip_tags(bbcode($b['body']));
                // quotes not working - let's try this
                $msg = html_entity_decode($msg);
-               if ( strlen($msg) > $max_char) {
+               if (( strlen($msg) > $max_char) && $max_char > 0) {
                        $shortlink = "";
                        require_once('library/slinky.php');
                        $slinky = new Slinky( $b['plink'] );