]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
allow oEmbed resources to be facebook attachments
authorCraig Andrews <candrews@integralblue.com>
Thu, 27 Aug 2009 02:09:46 +0000 (22:09 -0400)
committerCraig Andrews <candrews@integralblue.com>
Thu, 27 Aug 2009 02:09:46 +0000 (22:09 -0400)
lib/facebookutil.php

index 67c6ecbdf1c7c0d5757d381dad012f466b700494..fc68f2b2943dd245f4c2775b7c4a5460d8a6b018 100644 (file)
@@ -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{