$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
// TRANS: Title for leave group page after group join request is approved/disapproved.
+ // TRANS: %1$s is the user nickname, %2$s is the group nickname.
$this->element('title', null, sprintf(_m('TITLE','%1$s\'s request for %2$s'),
$this->profile->nickname,
$this->group->nickname));
$this->elementEnd('head');
$this->elementStart('body');
if ($this->approve) {
- $this->element('p', 'success', _m('Join request approved.'));
+ // TRANS: Message on page for group admin after approving a join request.
+ $this->element('p', 'success', _('Join request approved.'));
} elseif ($this->cancel) {
- $this->element('p', 'success', _m('Join request canceled.'));
+ // TRANS: Message on page for group admin after rejecting a join request.
+ $this->element('p', 'success', _('Join request canceled.'));
}
$this->elementEnd('body');
$this->elementEnd('html');
$screen_name,
$oldname));
}
-
} else {
// Kill any old, invalid records for this screen name
$fuser = Foreign_user::getByNickname($screen_name, TWITTER_SERVICE);
}
if (empty($status)) {
-
// This could represent a failure posting,
// or the Twitter API might just be behaving flakey.
$errmsg = sprintf('Twitter bridge - No data returned by Twitter API when ' .
common_log(LOG_WARNING, $logmsg);
+ // http://dev.twitter.com/pages/responses_errors
switch($code) {
+ case 400:
+ // Probably invalid data (bad Unicode chars or coords) that
+ // cannot be resolved by just sending again.
+ //
+ // It could also be rate limiting, but retrying immediately
+ // won't help much with that, so we'll discard for now.
+ // If a facility for retrying things later comes up in future,
+ // we can detect the rate-limiting headers and use that.
+ //
+ // Discard the message permanently.
+ return true;
+ break;
case 401:
// Probably a revoked or otherwise bad access token - nuke!
remove_twitter_link($flink);
// User has exceeder her rate limit -- toss the notice
return true;
break;
+ case 404:
+ // Resource not found. Shouldn't happen much on posting,
+ // but just in case!
+ //
+ // Consider it a matter for tossing the notice.
+ return true;
+ break;
default:
// For every other case, it's probably some flakiness so try
common_switch_locale($user->language);
- $subject = sprintf(_m('Your Twitter bridge has been disabled.'));
+ // TRANS: Mail subject after forwarding notices to Twitter has stopped working.
+ $subject = sprintf(_m('Your Twitter bridge has been disabled'));
$site_name = common_config('site', 'name');
+ // TRANS: Mail body after forwarding notices to Twitter has stopped working.
+ // TRANS: %1$ is the name of the user the mail is sent to, %2$s is a URL to the
+ // TRANS: Twitter settings, %3$s is the StatusNet sitename.
$body = sprintf(_m('Hi, %1$s. We\'re sorry to inform you that your ' .
'link to Twitter has been disabled. We no longer seem to have ' .
'permission to update your Twitter status. Did you maybe revoke ' .