save plink for diaspora items so likes will point to right post

This commit is contained in:
Friendika 2011-08-31 21:46:37 -07:00
parent 3cd8ee7161
commit 0cfc8570d2

View file

@ -457,7 +457,14 @@ function diaspora_post($importer,$xml) {
$datarray['body'] = $body; $datarray['body'] = $body;
$datarray['app'] = 'Diaspora'; $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; return;
@ -576,6 +583,13 @@ function diaspora_comment($importer,$xml,$msg) {
$message_id = 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)
);
}
if(! $parent_author_signature) { if(! $parent_author_signature) {
q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ", q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
intval($message_id), intval($message_id),
@ -805,6 +819,14 @@ EOT;
$message_id = item_store($arr); $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) { if(! $parent_author_signature) {
q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ", q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
intval($message_id), intval($message_id),