aboutsummaryrefslogtreecommitdiffstats
path: root/mod/share.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-10-27 11:07:40 +0100
committerMario Vavti <mario@mariovavti.com>2015-10-27 11:07:40 +0100
commit3f1dc22c0edc87e332c436d0426f9616e6500880 (patch)
tree3fa89cc8743cdd44aa934113e3eefc7ff108955b /mod/share.php
parent02527552fd6d17efdf4eb36a5e0403b2b7e19789 (diff)
downloadvolse-hubzilla-3f1dc22c0edc87e332c436d0426f9616e6500880.tar.gz
volse-hubzilla-3f1dc22c0edc87e332c436d0426f9616e6500880.tar.bz2
volse-hubzilla-3f1dc22c0edc87e332c436d0426f9616e6500880.zip
fix sharing of photo items
Diffstat (limited to 'mod/share.php')
-rw-r--r--mod/share.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/mod/share.php b/mod/share.php
index d5a389bdf..12938ae0d 100644
--- a/mod/share.php
+++ b/mod/share.php
@@ -42,6 +42,12 @@ function share_init(&$a) {
xchan_query($r);
+ $is_photo = (($r[0]['obj_type'] === ACTIVITY_OBJ_PHOTO) ? true : false);
+ if($is_photo) {
+ $object = json_decode($r[0]['object'],true);
+ $photo_bb = $object['bbcode'];
+ }
+
if (strpos($r[0]['body'], "[/share]") !== false) {
$pos = strpos($r[0]['body'], "[share");
$o = substr($r[0]['body'], $pos);
@@ -53,9 +59,9 @@ function share_init(&$a) {
"' posted='".$r[0]['created'].
"' message_id='".$r[0]['mid']."']";
if($r[0]['title'])
- $o .= '[b]'.$r[0]['title'].'[/b]'."\n";
- $o .= $r[0]['body'];
- $o.= "[/share]";
+ $o .= '[b]'.$r[0]['title'].'[/b]'."\r\n";
+ $o .= (($is_photo) ? $r[0]['body'] . "\r\n" . $photo_bb : $r[0]['body']);
+ $o .= "[/share]";
}
if(local_channel()) {