diff options
-rw-r--r-- | Zotlabs/Lib/Activity.php | 5 | ||||
-rwxr-xr-x | boot.php | 16 | ||||
-rw-r--r-- | include/photos.php | 8 |
3 files changed, 25 insertions, 4 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 02ec7614e..c50606d4f 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -323,6 +323,11 @@ class Activity { return $ret; } + + if ($i['obj']) { + $ret = Activity::encode_object($i['obj']); + } + $ret['type'] = $objtype; if ($objtype === 'Question') { @@ -1593,6 +1593,22 @@ function fix_system_urls($oldurl, $newurl) { } } + // fix links in apps + + $a = q("select id, app_url, app_photo from app where app_url like '%s' OR app_photo like '%s'", + dbesc('%' . $oldurl . '%'), + dbesc('%' . $oldurl . '%') + ); + if($a) { + foreach($a as $aa) { + q("update app set app_url = '%s', app_photo = '%s' where id = %d", + dbesc(str_replace($oldurl,$newurl,$aa['app_url'])), + dbesc(str_replace($oldurl,$newurl,$aa['app_photo'])), + intval($aa['id']) + ); + } + } + // now replace any remote xchans whose photos are stored locally (which will be most if not all remote xchans) $r = q("select * from xchan where xchan_photo_l like '%s'", diff --git a/include/photos.php b/include/photos.php index ee662f707..631660d7a 100644 --- a/include/photos.php +++ b/include/photos.php @@ -388,7 +388,7 @@ function photo_upload($channel, $observer, $args) { 'title' => $title, 'created' => $p['created'], 'edited' => $p['edited'], - 'id' => z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash, + 'id' => z_root() . '/item/' . $photo_hash, 'link' => $link, 'body' => $summary ); @@ -438,13 +438,13 @@ function photo_upload($channel, $observer, $args) { } } else { - $uuid = item_message_id(); - $mid = z_root() . '/item/' . $uuid; + // $uuid = item_message_id(); + $mid = z_root() . '/item/' . $photo_hash; $arr = [ 'aid' => $account_id, 'uid' => $channel_id, - 'uuid' => $uuid, + 'uuid' => $photo_hash, 'mid' => $mid, 'parent_mid' => $mid, 'item_hidden' => $item_hidden, |