X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=plugins%2FFacebookBridge%2Flib%2Ffacebookclient.php;h=0469ce8aca2aa7d98c9cebc8e2d8135a09630ed7;hb=f25b6e61166be9e27cba473e3f8544ef10b0577c;hp=37d6a0a7a01487ef5443607ed7454f09921d1cbc;hpb=36b331d469b6dcd1101783f21265f7be624bc58f;p=quix0rs-gnu-social.git diff --git a/plugins/FacebookBridge/lib/facebookclient.php b/plugins/FacebookBridge/lib/facebookclient.php index 37d6a0a7a0..0469ce8aca 100644 --- a/plugins/FacebookBridge/lib/facebookclient.php +++ b/plugins/FacebookBridge/lib/facebookclient.php @@ -340,7 +340,8 @@ class Facebookclient function checkPermission($permission) { if (!in_array($permission, array('publish_stream', 'status_update'))) { - throw new ServerException("No such permission!"); + // TRANS: Server exception thrown when permission check fails. + throw new ServerException(_('No such permission!')); } $fbuid = $this->flink->foreign_id; @@ -397,7 +398,6 @@ class Facebookclient ); return false; - } } @@ -461,7 +461,7 @@ class Facebookclient ), __FILE__ ); - // @fixme: We want to rety at a later time when the throttling has expired + // @todo FIXME: We want to rety at a later time when the throttling has expired // instead of just giving up. return true; break; @@ -582,7 +582,6 @@ class Facebookclient ); if (!empty($result)) { // result will contain the item ID - // Save a mapping Notice_to_item::saveNew($this->notice->id, $result); @@ -598,7 +597,6 @@ class Facebookclient ), __FILE__ ); - } else { $msg = sprintf( @@ -740,7 +738,6 @@ class Facebookclient $result = $this->mailFacebookDisconnect(); if (!$result) { - $msg = 'Unable to send email to notify %s (%d), fbuid %d ' . 'about his/her Facebook link being removed.'; @@ -755,9 +752,7 @@ class Facebookclient __FILE__ ); } - } else { - $msg = 'Unable to send email to notify %s (%d), fbuid %d ' . 'about his/her Facebook link being removed because the ' . 'user has not set an email address.'; @@ -789,26 +784,23 @@ class Facebookclient common_switch_locale($this->user->language); + // TRANS: E-mail subject. $subject = _m('Your Facebook connection has been removed'); - $msg = <<user->nickname, $siteName ); @@ -848,22 +840,21 @@ BODY; common_switch_locale($user->language); + // TRANS: E-mail subject. %s is the StatusNet sitename. $subject = _m('Contact the %s administrator to retrieve your account'); - $msg = <<nickname, $siteName, $siteEmail @@ -990,9 +981,7 @@ BODY; $n2i = Notice_to_item::staticGet('notice_id', $this->notice->id); if (!empty($this->flink) && !empty($n2i)) { - try { - $result = $this->facebook->api( array( 'method' => 'stream.remove', @@ -1002,7 +991,6 @@ BODY; ); if (!empty($result) && result == true) { - common_log( LOG_INFO, sprintf( @@ -1020,7 +1008,6 @@ BODY; } else { throw new FaceboookApiException(var_export($result, true)); } - } catch (FacebookApiException $e) { common_log( LOG_WARNING, @@ -1049,9 +1036,7 @@ BODY; $n2i = Notice_to_item::staticGet('notice_id', $this->notice->id); if (!empty($this->flink) && !empty($n2i)) { - try { - $result = $this->facebook->api( array( 'method' => 'stream.addlike', @@ -1061,7 +1046,6 @@ BODY; ); if (!empty($result) && result == true) { - common_log( LOG_INFO, sprintf( @@ -1073,11 +1057,9 @@ BODY; ), __FILE__ ); - } else { throw new FacebookApiException(var_export($result, true)); } - } catch (FacebookApiException $e) { common_log( LOG_WARNING, @@ -1105,9 +1087,7 @@ BODY; $n2i = Notice_to_item::staticGet('notice_id', $this->notice->id); if (!empty($this->flink) && !empty($n2i)) { - try { - $result = $this->facebook->api( array( 'method' => 'stream.removeLike', @@ -1117,7 +1097,6 @@ BODY; ); if (!empty($result) && result == true) { - common_log( LOG_INFO, sprintf( @@ -1133,7 +1112,6 @@ BODY; } else { throw new FacebookApiException(var_export($result, true)); } - } catch (FacebookApiException $e) { common_log( LOG_WARNING, @@ -1151,5 +1129,4 @@ BODY; } } } - }