summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2010-01-22 19:19:02 +0100
committerSarven Capadisli <csarven@status.net>2010-01-22 19:19:02 +0100
commit00547ca898733973eea7375152a3cfc83b50ae20 (patch)
tree7712a8356a570950e256903a063d392e66e5a826
parentc9aafe2d4ff8ae2057d124e3ca281679c7ff0885 (diff)
parentb7940ef39f476b6a4cd7619267b735e98b0d7cfa (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
-rw-r--r--classes/File.php2
-rw-r--r--lib/api.php9
-rw-r--r--lib/unqueuemanager.php2
-rw-r--r--lib/util.php17
4 files changed, 13 insertions, 17 deletions
diff --git a/classes/File.php b/classes/File.php
index c527c4ffe..34e4632a8 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -251,6 +251,8 @@ class File extends Memcached_DataObject
if($oembed->modified) $enclosure->modified=$oembed->modified;
unset($oembed->size);
}
+ } else {
+ return false;
}
}
}
diff --git a/lib/api.php b/lib/api.php
index 794b14050..825262b4c 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -288,11 +288,12 @@ class ApiAction extends Action
$twitter_status['attachments'] = array();
foreach ($attachments as $attachment) {
- if ($attachment->isEnclosure()) {
+ $enclosure_o=$attachment->getEnclosure();
+ if ($enclosure_o) {
$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;
}
}
diff --git a/lib/unqueuemanager.php b/lib/unqueuemanager.php
index 5595eac05..785de7c8c 100644
--- a/lib/unqueuemanager.php
+++ b/lib/unqueuemanager.php
@@ -47,7 +47,7 @@ class UnQueueManager extends QueueManager
$handler = $this->getHandler($queue);
if ($handler) {
- $handler->handle_notice($notice);
+ $handler->handle($notice);
} else {
if (Event::handle('UnqueueHandleNotice', array(&$notice, $queue))) {
throw new ServerException("UnQueueManager: Unknown queue: $queue");
diff --git a/lib/util.php b/lib/util.php
index fb3b8be87..01b159ac1 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -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;
}
}
}