X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdiaspora.php;h=10b342289719789bb13ed1aa643b88ca81151e55;hb=030dcbd467d5faf01e6f62b9cd9b1be6f8974dcc;hp=e3ab9458d2c49626d50a63f95bc84274de9c0b8d;hpb=3bbdbee87cecc9b8c387ea6df5754b6c960d0633;p=friendica.git diff --git a/include/diaspora.php b/include/diaspora.php index e3ab9458d2..10b3422897 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -3,6 +3,7 @@ require_once('include/crypto.php'); require_once('include/items.php'); require_once('include/bb2diaspora.php'); +require_once('include/contact_selectors.php'); function diaspora_dispatch($importer,$msg) { @@ -1060,10 +1061,24 @@ function diaspora_send_relay($item,$owner,$contact) { $like = false; } - $text = html_entity_decode(bb2diaspora($item['body'])); + $body = $item['body']; + + $itemcontact = q("select * from contact where `id` = %d limit 1", + intval($item['contact-id']) + ); + if(count($itemcontact)) { + if(! $itemcontact[0]['self']) { + $prefix = sprintf( t('[Relayed] Comment authored by %s from network %s'), + '['. $item['author-name'] . ']' . '(' . $item['author-link'] . ')', + network_to_name($itemcontact['network'])) . "\n"; + $body = $prefix . $body; + } + } + + $text = html_entity_decode(bb2diaspora($body)); // fetch the original signature if somebody sent the post to us to relay - // if we are relaying for a reply originating here, there wasn't a 'send to relay' + // If we are relaying for a reply originating here, there wasn't a 'send to relay' // action. It wasn't needed. In that case create the original signature and the // owner (parent author) signature @@ -1076,6 +1091,10 @@ function diaspora_send_relay($item,$owner,$contact) { $authorsig = $orig_sign['signature']; } else { + + + + if($like) $signed_text = $item['guid'] . ';' . $target_type . ';' . $parent_guid . ';' . $positive . ';' . $myaddr; else