]> 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)
committerCraig Andrews <candrews@integralblue.com>
Fri, 22 Jan 2010 15:12:26 +0000 (10:12 -0500)
classes/File.php
lib/api.php
lib/util.php

index c527c4ffe92012a2877b434bb83becfd44fc6891..34e4632a8c2760d12e9fc876437db256caf4a1b4 100644 (file)
@@ -251,6 +251,8 @@ class File extends Memcached_DataObject
                         if($oembed->modified) $enclosure->modified=$oembed->modified;
                         unset($oembed->size);
                     }
+                } else {
+                    return false;
                 }
             }
         }
index 794b14050709dddb7d9503a3cad05b829a783cce..b4803fe62de5e0f3e02b3709d28fc6c94b4a6339 100644 (file)
@@ -288,11 +288,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 fb3b8be8765b3ab7c5a79924170b11ebe049d636..01b159ac1596cf5abecd33a5a0b566ca48db4c50 100644 (file)
@@ -596,20 +596,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;
             }
         }
     }