aboutsummaryrefslogtreecommitdiffstats
path: root/include/bb2diaspora.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-10-25 14:33:57 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-10-25 14:33:57 -0700
commitb67397861c75e8da465d2a730b1e75b6bd0a72ee (patch)
tree3f9f27b267eb15f435a7e0457017382919b3c962 /include/bb2diaspora.php
parentde15a2ace16f4499945edb90f0e3645ad537ef1f (diff)
parent911fd6c654435e60167007fd95a4e8ace50806e8 (diff)
downloadvolse-hubzilla-b67397861c75e8da465d2a730b1e75b6bd0a72ee.tar.gz
volse-hubzilla-b67397861c75e8da465d2a730b1e75b6bd0a72ee.tar.bz2
volse-hubzilla-b67397861c75e8da465d2a730b1e75b6bd0a72ee.zip
Merge https://github.com/redmatrix/hubzilla into pending_merge
Diffstat (limited to 'include/bb2diaspora.php')
-rw-r--r--include/bb2diaspora.php13
1 files changed, 4 insertions, 9 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 95de43ec3..d10ed57eb 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -309,15 +309,10 @@ function bb2diaspora_itembody($item, $force_update = false) {
$is_photo = (($item['obj_type'] == ACTIVITY_OBJ_PHOTO) ? true : false);
if($is_photo) {
$object = json_decode($item['object'],true);
- $photo = array(
- 'url' => rawurldecode($object['id']),
- 'link' => rawurldecode(get_rel_link($object['link'],'alternate')),
- 'width' => $object['width'],
- 'height' => $object['height']
- );
-
- $photo_bb = '[zrl=' . $photo['link'] . ']' . '[zmg=' . $photo['width'] . 'x' . $photo['height'] . ']' . $photo['url'] . '[/zmg]' . '[/zrl]';
- $item['body'] = (($item['body']) ? $photo_bb . $item['body'] : $photo_bb);
+ if($object['link'][2]) {
+ $photo_bb = '[zrl=' . rawurldecode($object['id']) . ']' . '[zmg=' . $object['link'][2]['width'] . 'x' . $object['link'][2]['height'] . ']' . rawurldecode($object['link'][2]['href']) . '[/zmg]' . '[/zrl]';
+ $item['body'] = (($item['body']) ? $photo_bb . $item['body'] : $photo_bb);
+ }
}
if(($item['diaspora_meta']) && (! $force_update)) {