]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/facebookutil.php
Some UI adjustments for form notice
[quix0rs-gnu-social.git] / lib / facebookutil.php
index 67c6ecbdf1c7c0d5757d381dad012f466b700494..f5121609d6fbc078ec3fb8ec1235d07bca3b6aae 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -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{