create photo object if feature large photos is enabled and display those slightly different

This commit is contained in:
Mario Vavti
2015-10-20 09:36:15 +02:00
parent 54059b2f15
commit f7601756e9
10 changed files with 98 additions and 31 deletions

View File

@@ -305,6 +305,21 @@ function bb2diaspora_itembody($item, $force_update = false) {
$matches = array();
//if we have a photo item just prepend the photo bbcode to item['body']
$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(($item['diaspora_meta']) && (! $force_update)) {
$diaspora_meta = json_decode($item['diaspora_meta'],true);
if($diaspora_meta) {