aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-08-28 05:00:30 -0700
committerFriendika <info@friendika.com>2011-08-28 05:00:30 -0700
commit41b00a6f3b6e46b4886e91069109b538f7596b12 (patch)
treed68a42310c7c9a37883e003459e305a08027664f /include
parentada8bee70e89c34afa53eff9ad70315cfcd34c6d (diff)
downloadvolse-hubzilla-41b00a6f3b6e46b4886e91069109b538f7596b12.tar.gz
volse-hubzilla-41b00a6f3b6e46b4886e91069109b538f7596b12.tar.bz2
volse-hubzilla-41b00a6f3b6e46b4886e91069109b538f7596b12.zip
allow comment relaying for comments which were never Diaspora signed
Diffstat (limited to 'include')
-rw-r--r--include/diaspora.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index e3ab9458d..9a43c7b07 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,22 @@ function diaspora_send_relay($item,$owner,$contact) {
$like = false;
}
+ $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($item['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 +1089,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