]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/TwitterBridge/twitter.php
Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 1.0.x
[quix0rs-gnu-social.git] / plugins / TwitterBridge / twitter.php
index d984698ee8ea1e1147db7011c09865e51d2bd338..cd1ad70b9b8369fe9b512afd8d18cb5b1d4ff10e 100644 (file)
@@ -282,15 +282,14 @@ function process_error($e, $flink, $notice)
 
 function format_status($notice)
 {
-    // XXX: Hack to get around PHP cURL's use of @ being a a meta character
-    $statustxt = preg_replace('/^@/', ' @', $notice->content);
+    // Start with the plaintext source of this notice...
+    $statustxt = $notice->content;
 
     // Convert !groups to #hashes
-
     // XXX: Make this an optional setting?
-
     $statustxt = preg_replace('/(^|\s)!([A-Za-z0-9]{1,64})/', "\\1#\\2", $statustxt);
 
+    // Twitter still has a 140-char hardcoded max.
     if (mb_strlen($statustxt) > 140) {
         $noticeUrl = common_shorten_url($notice->uri);
         $urlLen = mb_strlen($noticeUrl);
@@ -318,11 +317,9 @@ function remove_twitter_link($flink)
     // Notify the user that her Twitter bridge is down
 
     if (isset($user->email)) {
-
         $result = mail_twitter_bridge_removed($user);
 
         if (!$result) {
-
             $msg = 'Unable to send email to notify ' .
               "$user->nickname (user id: $user->id) " .
               'that their Twitter bridge link was ' .
@@ -331,7 +328,6 @@ function remove_twitter_link($flink)
             common_log(LOG_WARNING, $msg);
         }
     }
-
 }
 
 /**
@@ -360,7 +356,7 @@ function mail_twitter_bridge_removed($user)
     '%3$s\'s access?' . "\n\n" .
     'You can re-enable your Twitter bridge by visiting your ' .
     "Twitter settings page:\n\n\t%2\$s\n\n" .
-        "Regards,\n%3\$s\n"),
+        "Regards,\n%3\$s"),
         $profile->getBestName(),
         common_local_url('twittersettings'),
         common_config('site', 'name'));