diff options
author | Friendika <info@friendika.com> | 2011-08-31 21:46:37 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-08-31 21:46:37 -0700 |
commit | 0cfc8570d20ef4935e846f0f143aef181b9c951f (patch) | |
tree | 390b867b4ca9294427a91616e1cb46c2dad6c392 | |
parent | 3cd8ee716123e1fc0c6092a9af3b7d825fffe116 (diff) | |
download | volse-hubzilla-0cfc8570d20ef4935e846f0f143aef181b9c951f.tar.gz volse-hubzilla-0cfc8570d20ef4935e846f0f143aef181b9c951f.tar.bz2 volse-hubzilla-0cfc8570d20ef4935e846f0f143aef181b9c951f.zip |
save plink for diaspora items so likes will point to right post
-rw-r--r-- | include/diaspora.php | 24 |
1 files changed, 23 insertions, 1 deletions
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), |