]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Updated some references to the long gnone "isEnclosure" function to the new "getEnclo...
authorCraig Andrews <candrews@integralblue.com>
Fri, 22 Jan 2010 15:12:26 +0000 (10:12 -0500)
committerZach Copley <zach@status.net>
Wed, 3 Mar 2010 17:52:24 +0000 (09:52 -0800)
classes/File.php
lib/apiaction.php
lib/util.php

index 91b12d2e28664e61206aadb9abb4e8301fe21441..189e04ce021d77dc74a29ee14dbb64df118b4c2e 100644 (file)
@@ -279,6 +279,8 @@ class File extends Memcached_DataObject
                         if($oembed->modified) $enclosure->modified=$oembed->modified;
                         unset($oembed->size);
                     }
+                } else {
+                    return false;
                 }
             }
         }
index 2af150ab994d6f5bc9c60a849fadf0c7c715be41..f7b4ef473e3c08a2689d1fae3d317cc1473d222f 100644 (file)
@@ -289,11 +289,12 @@ class ApiAction extends Action
             $twitter_status['attachments'] = array();
 
             foreach ($attachments as $attachment) {
-                if ($attachment->isEnclosure()) {
+                $enclosure_o=$attachment->getEnclosure();
+                if ($attachment_enclosure) {
                     $enclosure = array();
-                    $enclosure['url'] = $attachment->url;
-                    $enclosure['mimetype'] = $attachment->mimetype;
-                    $enclosure['size'] = $attachment->size;
+                    $enclosure['url'] = $enclosure_o->url;
+                    $enclosure['mimetype'] = $enclosure_o->mimetype;
+                    $enclosure['size'] = $enclosure_o->size;
                     $twitter_status['attachments'][] = $enclosure;
                 }
             }
index f793cc10e9f28550823352e39fd2671def94c94a..77a332b5ecdd8386fcb48fc68d1657b7e34b9929 100644 (file)
@@ -731,20 +731,13 @@ function common_linkify($url) {
     }
 
     if (!empty($f)) {
-        if ($f->isEnclosure()) {
+        if ($f->getEnclosure()) {
             $is_attachment = true;
             $attachment_id = $f->id;
-        } else {
-            $foe = File_oembed::staticGet('file_id', $f->id);
-            if (!empty($foe)) {
-                // if it has OEmbed info, it's an attachment, too
-                $is_attachment = true;
-                $attachment_id = $f->id;
-
-                $thumb = File_thumbnail::staticGet('file_id', $f->id);
-                if (!empty($thumb)) {
-                    $has_thumb = true;
-                }
+
+            $thumb = File_thumbnail::staticGet('file_id', $f->id);
+            if (!empty($thumb)) {
+                $has_thumb = true;
             }
         }
     }