From f0a4a6af619b2d9b2fca217c24667f8eea429b62 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 30 Aug 2011 19:20:56 -0700 Subject: relayed likes did not verify --- include/diaspora.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/diaspora.php') diff --git a/include/diaspora.php b/include/diaspora.php index fc9289039..0ab467829 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -732,8 +732,8 @@ function diaspora_like($importer,$xml,$msg) { } if($parent_author_signature) { -// $owner_signed_data = $guid . ';' . $parent_guid . ';' . $target_type . ';' . $positive . ';' . $msg['author']; - $owner_signed_data = $guid . ';' . $parent_guid . ';' . $target_type . ';' . $positive . ';' . $diaspora_handle; + + $owner_signed_data = $guid . ';' . $target_type . ';' . $parent_guid . ';' . $positive . ';' . $diaspora_handle; $parent_author_signature = base64_decode($parent_author_signature); -- cgit v1.2.3 From 0cfc8570d20ef4935e846f0f143aef181b9c951f Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 31 Aug 2011 21:46:37 -0700 Subject: save plink for diaspora items so likes will point to right post --- include/diaspora.php | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'include/diaspora.php') diff --git a/include/diaspora.php b/include/diaspora.php index 0ab467829..89afc46f9 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -457,7 +457,14 @@ function diaspora_post($importer,$xml) { $datarray['body'] = $body; $datarray['app'] = 'Diaspora'; - item_store($datarray); + $message_id = item_store($datarray); + + if($message_id) { + q("update item set plink = '%s' where id = %d limit 1", + dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id), + intval($message_id) + ); + } return; @@ -576,6 +583,13 @@ function diaspora_comment($importer,$xml,$msg) { $message_id = item_store($datarray); + if($message_id) { + q("update item set plink = '%s' where id = %d limit 1", + dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id), + intval($message_id) + ); + } + if(! $parent_author_signature) { q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ", intval($message_id), @@ -805,6 +819,14 @@ EOT; $message_id = item_store($arr); + + if($message_id) { + q("update item set plink = '%s' where id = %d limit 1", + dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id), + intval($message_id) + ); + } + if(! $parent_author_signature) { q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ", intval($message_id), -- cgit v1.2.3 From c8f61ef890e39d703a4f4aff612793177034415a Mon Sep 17 00:00:00 2001 From: Friendika Date: Sat, 3 Sep 2011 05:23:36 -0700 Subject: no plink on imported D* posts --- include/diaspora.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/diaspora.php') diff --git a/include/diaspora.php b/include/diaspora.php index 89afc46f9..6d070ecba 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -398,6 +398,7 @@ function diaspora_request($importer,$xml) { function diaspora_post($importer,$xml) { + $a = get_app(); $guid = notags(unxmlify($xml->guid)); $diaspora_handle = notags(unxmlify($xml->diaspora_handle)); @@ -472,6 +473,7 @@ function diaspora_post($importer,$xml) { function diaspora_comment($importer,$xml,$msg) { + $a = get_app(); $guid = notags(unxmlify($xml->guid)); $parent_guid = notags(unxmlify($xml->parent_guid)); $diaspora_handle = notags(unxmlify($xml->diaspora_handle)); @@ -609,6 +611,7 @@ function diaspora_comment($importer,$xml,$msg) { function diaspora_photo($importer,$xml,$msg) { + $a = get_app(); $remote_photo_path = notags(unxmlify($xml->remote_photo_path)); $remote_photo_name = notags(unxmlify($xml->remote_photo_name)); -- cgit v1.2.3