]> git.mxchange.org Git - friendica-addons.git/commitdiff
Merge https://github.com/friendica/friendica-addons into apull
authorfriendica <info@friendica.com>
Tue, 9 Jul 2013 00:42:26 +0000 (17:42 -0700)
committerfriendica <info@friendica.com>
Tue, 9 Jul 2013 00:42:26 +0000 (17:42 -0700)
twitter/twitter.php
webrtc/README.md

index 9327080676b7f3f2ef3243f3cfb9bfca23da2ee9..1b9f2c1b06961c53cc0019a83066915671635b13 100755 (executable)
@@ -421,11 +421,22 @@ function twitter_shortenmsg($b) {
        if ((strlen(trim($origmsg)) <= ($max_char - 3)) AND strpos($origmsg, $msglink))
                return(trim($origmsg));
 
-       if (strlen($msglink) > 20)
-               $msglink = short_link($msglink);
-
-       if (strlen(trim($msg." ".$msglink)) > ($max_char - 3)) {
-               $msg = substr($msg, 0, ($max_char - 3) - (strlen($msglink)));
+       // Preserve the unshortened link
+       $orig_link = $msglink;
+
+       //if (strlen($msglink) > 20)
+       //      $msglink = short_link($msglink);
+       //
+       //if (strlen(trim($msg." ".$msglink)) > ($max_char - 3)) {
+       //      $msg = substr($msg, 0, ($max_char - 3) - (strlen($msglink)));
+
+       // Just replace the message link with a 15 character long string
+       // Twitter shortens it anyway to this length
+       if (trim($msglink) <> '')
+               $msglink = "123456789012345";
+
+       if (strlen(trim($msg." ".$msglink)) > ($max_char)) {
+               $msg = substr($msg, 0, ($max_char) - (strlen($msglink)));
                $lastchar = substr($msg, -1);
                $msg = substr($msg, 0, -1);
                $pos = strrpos($msg, "\n");
@@ -440,7 +451,8 @@ function twitter_shortenmsg($b) {
        while (strpos($msg, "  ") !== false)
                $msg = str_replace("  ", " ", $msg);
 
-       return(trim($msg." ".$msglink));
+       //return(trim($msg." ".$msglink));
+       return(trim($msg." ".$orig_link));
 }
 
 function twitter_post_hook(&$a,&$b) {
index d29500a67f3e59a18279e22496c2fea2c7a9fdbf..4f6c55cacfe5cad76e16fbee83d7f22e89ba0d2f 100644 (file)
@@ -19,6 +19,6 @@ question).
 
 If the test is successful then proceed with copying the webrtc instance you
 would like to use and place it in the config window and save. Now when you
-openhe app it will load the webrtc instance for you to use.
+open the app it will load the webrtc instance for you to use.
 
 [1]: https://en.wikipedia.org/wiki/WebRTC