We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 94f2f96f authored by Brion Vibber's avatar Brion Vibber

Ticket #2724: gracefully handle attempts to delete or fave/unfave a remote...

Ticket #2724: gracefully handle attempts to delete or fave/unfave a remote Twitter notice if a failure occurs.

Most annoying error case being where the notice was already faved or deleted on Twitter! :)
Such errors will now just fail out and log a note to the syslog -- the rest of what we were doing will continue on unhindered, so you can still delete, favorite, etc and it just won't sync the info over in that case.
parent 4193a826
......@@ -427,10 +427,14 @@ class TwitterBridgePlugin extends Plugin
return true;
}
$token = TwitterOAuthClient::unpackToken($flink->credentials);
$client = new TwitterOAuthClient($token->key, $token->secret);
try {
$token = TwitterOAuthClient::unpackToken($flink->credentials);
$client = new TwitterOAuthClient($token->key, $token->secret);
$client->statusesDestroy($n2s->status_id);
$client->statusesDestroy($n2s->status_id);
} catch (Exception $e) {
common_log(LOG_ERR, "Error attempting to delete bridged notice from Twitter: " . $e->getMessage());
}
$n2s->delete();
}
......@@ -464,10 +468,14 @@ class TwitterBridgePlugin extends Plugin
return true;
}
$token = TwitterOAuthClient::unpackToken($flink->credentials);
$client = new TwitterOAuthClient($token->key, $token->secret);
try {
$token = TwitterOAuthClient::unpackToken($flink->credentials);
$client = new TwitterOAuthClient($token->key, $token->secret);
$client->favoritesCreate($status_id);
$client->favoritesCreate($status_id);
} catch (Exception $e) {
common_log(LOG_ERR, "Error attempting to favorite bridged notice on Twitter: " . $e->getMessage());
}
return true;
}
......@@ -500,10 +508,14 @@ class TwitterBridgePlugin extends Plugin
return true;
}
$token = TwitterOAuthClient::unpackToken($flink->credentials);
$client = new TwitterOAuthClient($token->key, $token->secret);
try {
$token = TwitterOAuthClient::unpackToken($flink->credentials);
$client = new TwitterOAuthClient($token->key, $token->secret);
$client->favoritesDestroy($status_id);
$client->favoritesDestroy($status_id);
} catch (Exception $e) {
common_log(LOG_ERR, "Error attempting to unfavorite bridged notice on Twitter: " . $e->getMessage());
}
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment