aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-10-20 13:03:28 +0200
committerMario Vavti <mario@mariovavti.com>2015-10-20 13:03:28 +0200
commit81b2c5ac684cda4b958f1eb46496525ca005b174 (patch)
tree91a6eb11450c628c2dfa178995442978d473385a
parent35b5f60f9911e4114468dc2f3d84e73545029033 (diff)
downloadvolse-hubzilla-81b2c5ac684cda4b958f1eb46496525ca005b174.tar.gz
volse-hubzilla-81b2c5ac684cda4b958f1eb46496525ca005b174.tar.bz2
volse-hubzilla-81b2c5ac684cda4b958f1eb46496525ca005b174.zip
fix jot photo upload
-rw-r--r--include/photos.php16
1 files changed, 6 insertions, 10 deletions
diff --git a/include/photos.php b/include/photos.php
index 2ec983833..0b59019ef 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -281,12 +281,11 @@ function photo_upload($channel, $observer, $args) {
$width = $r2width;
$height = $r2height;
$tag = (($r2) ? '[zmg=' . $width . 'x' . $height . ']' : '[zmg]');
-
- $body = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']'
- . $tag . z_root() . "/photo/{$photo_hash}-{$scale}.".$ph->getExt() . '[/zmg]'
- . '[/zrl]';
}
+ $body = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']'
+ . $tag . z_root() . "/photo/{$photo_hash}-{$scale}.".$ph->getExt() . '[/zmg]'
+ . '[/zrl]';
// Create item container
@@ -298,10 +297,7 @@ function photo_upload($channel, $observer, $args) {
if($item['mid'] === $item['parent_mid']) {
- $item['body'] = (($body) ? $body: '');
-
- $arr['obj_type'] = (($object) ? ACTIVITY_OBJ_PHOTO : '');
- $arr['object'] = (($object) ? json_encode($object) : '');
+ $item['body'] = $body;
if($item['author_xchan'] === $channel['channel_hash']) {
$item['sig'] = base64url_encode(rsa_sign($item['body'],$channel['channel_prvkey']));
@@ -362,7 +358,7 @@ function photo_upload($channel, $observer, $args) {
$arr['item_thread_top'] = 1;
$arr['item_private'] = intval($acl->is_private());
$arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $arr['mid'];
- $arr['body'] = (($body) ? $body : '');
+ $arr['body'] = (($object) ? '' : $body);
$result = item_store($arr);
$item_id = $result['item_id'];
@@ -373,7 +369,7 @@ function photo_upload($channel, $observer, $args) {
$ret['success'] = true;
$ret['item'] = $arr;
- $ret['body'] = $arr['body'];
+ $ret['body'] = $body;
$ret['resource_id'] = $photo_hash;
$ret['photoitem_id'] = $item_id;