summaryrefslogtreecommitdiff
path: root/lib/facebookutil.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/facebookutil.php')
-rw-r--r--lib/facebookutil.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/facebookutil.php b/lib/facebookutil.php
index c29576b64..c991c5439 100644
--- a/lib/facebookutil.php
+++ b/lib/facebookutil.php
@@ -109,7 +109,6 @@ function facebookBroadcastNotice($notice)
$can_update = $facebook->api_client->users_hasAppPermission('status_update',
$fbuid);
-
if (!empty($attachments) && $can_publish == 1) {
$fbattachment = format_attachments($attachments);
$facebook->api_client->stream_publish($status, $fbattachment,
@@ -180,7 +179,11 @@ function format_attachments($attachments)
foreach($attachments as $attachment)
{
- $fbmedia = get_fbmedia_for_attachment($attachment);
+ if($enclosure = $attachment->getEnclosure()){
+ $fbmedia = get_fbmedia_for_attachment($enclosure);
+ }else{
+ $fbmedia = get_fbmedia_for_attachment($attachment);
+ }
if($fbmedia){
$fbattachment['media'][]=$fbmedia;
}else{