aboutsummaryrefslogtreecommitdiffstats
path: root/include/bb2diaspora.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-12-15 15:01:54 -0800
committerredmatrix <redmatrix@redmatrix.me>2015-12-15 15:01:54 -0800
commit2924b9182e787d0266e433169b1db1c3fdd359a7 (patch)
treef0125fa6cd46a0147301af27d91031bfcdd45d55 /include/bb2diaspora.php
parentba463afbdcded70b88a48d76276d837a7e78ef0c (diff)
downloadvolse-hubzilla-2924b9182e787d0266e433169b1db1c3fdd359a7.tar.gz
volse-hubzilla-2924b9182e787d0266e433169b1db1c3fdd359a7.tar.bz2
volse-hubzilla-2924b9182e787d0266e433169b1db1c3fdd359a7.zip
revise the photo activity a bit so that we always have a valid activity body. Several network connectors can get empty posts or posts that don't contain any reference whatsoever to the actual photo. Since this can cause duplicate images on our own site, just provide the activity summary and any included body text to the activity by default. Provide a function to enhance this activity with an actual photo which can be applied on demand for any network connectors that desire it. Otherwise they'll just get a link to the photo in the activity statement - which is better than an empty post. Have applied this "add actual photo to the post" function to both Diaspora and RSS feeds. Also provide the album as the activity target.
Diffstat (limited to 'include/bb2diaspora.php')
-rw-r--r--include/bb2diaspora.php20
1 files changed, 1 insertions, 19 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index e2ce3f1b0..81b95b30b 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -305,15 +305,6 @@ 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);
- if($object['bbcode']) {
- $item['body'] = (($item['body']) ? $object['bbcode'] . "\r\n" . $item['body'] : $object['bbcode']);
- }
- }
-
if(($item['diaspora_meta']) && (! $force_update)) {
$diaspora_meta = json_decode($item['diaspora_meta'],true);
if($diaspora_meta) {
@@ -333,16 +324,7 @@ function bb2diaspora_itembody($item, $force_update = false) {
}
}
-
- // since November 2015 linked photo items don't or at least may not have a body. Recreate one.
-
- if(($item['verb'] === ACTIVITY_POST) && ($item['obj_type'] === ACTIVITY_OBJ_PHOTO) && (! trim($item['body']))) {
- $j = json_decode($item['object'],true);
- if($j) {
- $item['body'] = $j['bbcode'];
- $item['sig'] = '';
- }
- }
+ create_export_photo_body($item);
$newitem = $item;