aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-08-18 05:08:39 -0700
committerFriendika <info@friendika.com>2011-08-18 05:08:39 -0700
commit012e039dae4b8f6207b0f0e58667819c016948a2 (patch)
treec7269434c37c4a9b5851f12d1e56ff5ca3c7de15
parent0808e4c930de84d0a68fe8fc4b7683110b6b6fed (diff)
downloadvolse-hubzilla-012e039dae4b8f6207b0f0e58667819c016948a2.tar.gz
volse-hubzilla-012e039dae4b8f6207b0f0e58667819c016948a2.tar.bz2
volse-hubzilla-012e039dae4b8f6207b0f0e58667819c016948a2.zip
store signature data if applicable for relaying
-rw-r--r--include/diaspora.php25
1 files changed, 22 insertions, 3 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index 81e335dd4..6fe08dcd0 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -510,6 +510,7 @@ function diaspora_comment($importer,$xml,$msg) {
return;
}
+
if($parent_author_signature) {
$owner_signed_data = $guid . ';' . $parent_guid . ';' . $text . ';' . $msg['author'];
@@ -576,8 +577,18 @@ function diaspora_comment($importer,$xml,$msg) {
$datarray['author-avatar'] = ((x($person,'thumb')) ? $person['thumb'] : $person['photo']);
$datarray['body'] = $body;
- item_store($datarray);
+ $message_id = item_store($datarray);
+
+ if(! $parent_author_signature) {
+ q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
+ intval($message_id),
+ dbesc($author_signed_data),
+ dbesc(base64_encode($author_signature)),
+ dbesc($diaspora_handle)
+ );
+ }
+ // notify others
return;
}
@@ -734,12 +745,20 @@ EOT;
$arr['unseen'] = 1;
$arr['last-child'] = 0;
- $post_id = item_store($arr);
+ $message_id = item_store($arr);
+ if(! $parent_author_signature) {
+ q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
+ intval($message_id),
+ dbesc($author_signed_data),
+ dbesc(base64_encode($author_signature)),
+ dbesc($diaspora_handle)
+ );
+ }
// FIXME send notification
-
+ return;
}
function diaspora_retraction($importer,$xml) {