mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-19 21:03:41 +00:00
fromgplus: Bigger images for notes.
Twitter: When a post with a media failes then it is posted as a post without media.
This commit is contained in:
parent
83f95acbbf
commit
e226b74b7e
2 changed files with 9 additions and 7 deletions
|
@ -239,9 +239,11 @@ function fromgplus_handleattachments($item, $displaytext) {
|
||||||
$post .= "\n\n[bookmark=".$attachment->url."]".fromgplus_html2bbcode($attachment->displayName)."[/bookmark]\n";
|
$post .= "\n\n[bookmark=".$attachment->url."]".fromgplus_html2bbcode($attachment->displayName)."[/bookmark]\n";
|
||||||
|
|
||||||
$images = fromgplus_cleanupgoogleproxy($attachment->fullImage, $attachment->image);
|
$images = fromgplus_cleanupgoogleproxy($attachment->fullImage, $attachment->image);
|
||||||
if ($images["preview"] != "")
|
//if ($images["preview"] != "")
|
||||||
$post .= "\n[url=".$images["full"]."][img]".$images["preview"]."[/img][/url]\n";
|
// $post .= "\n[url=".$images["full"]."][img]".$images["preview"]."[/img][/url]\n";
|
||||||
elseif ($images["full"] != "")
|
//elseif ($images["full"] != "")
|
||||||
|
// $post .= "\n[img]".$images["full"]."[/img]\n";
|
||||||
|
if ($images["full"] != "")
|
||||||
$post .= "\n[img]".$images["full"]."[/img]\n";
|
$post .= "\n[img]".$images["full"]."[/img]\n";
|
||||||
|
|
||||||
//$post .= "[quote]".trim(fromgplus_html2bbcode($attachment->content))."[/quote]";
|
//$post .= "[quote]".trim(fromgplus_html2bbcode($attachment->content))."[/quote]";
|
||||||
|
|
|
@ -641,8 +641,8 @@ function twitter_post_hook(&$a,&$b) {
|
||||||
$result = $tweet->post('statuses/update_with_media', array('media[]' => "{$img_str};type=".$mime.";filename={$filename}" , 'status' => $msg));
|
$result = $tweet->post('statuses/update_with_media', array('media[]' => "{$img_str};type=".$mime.";filename={$filename}" , 'status' => $msg));
|
||||||
|
|
||||||
logger('twitter_post_with_media send, result: ' . print_r($result, true), LOGGER_DEBUG);
|
logger('twitter_post_with_media send, result: ' . print_r($result, true), LOGGER_DEBUG);
|
||||||
if ($result->error) {
|
if ($result->errors OR $result->error) {
|
||||||
logger('Send to Twitter failed: "' . $result->error . '"');
|
logger('Send to Twitter failed: "' . $result->errors . '"');
|
||||||
// Workaround: Remove the picture link so that the post can be reposted without it
|
// Workaround: Remove the picture link so that the post can be reposted without it
|
||||||
$image = "";
|
$image = "";
|
||||||
}
|
}
|
||||||
|
@ -651,8 +651,8 @@ function twitter_post_hook(&$a,&$b) {
|
||||||
if(strlen($msg) and ($image == "")) {
|
if(strlen($msg) and ($image == "")) {
|
||||||
$result = $tweet->post('statuses/update', array('status' => $msg));
|
$result = $tweet->post('statuses/update', array('status' => $msg));
|
||||||
logger('twitter_post send, result: ' . print_r($result, true), LOGGER_DEBUG);
|
logger('twitter_post send, result: ' . print_r($result, true), LOGGER_DEBUG);
|
||||||
if ($result->error)
|
if ($result->errors OR $result->error)
|
||||||
logger('Send to Twitter failed: "' . $result->error . '"');
|
logger('Send to Twitter failed: "' . $result->errors . '"');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue