Merge pull request #10348 from annando/fix-diaspora-comment
Fix commenting on mobile to Diaspora
This commit is contained in:
commit
d99286640d
3 changed files with 11 additions and 13 deletions
|
@ -714,13 +714,6 @@ function item_post(App $a) {
|
||||||
unset($datarray['self']);
|
unset($datarray['self']);
|
||||||
unset($datarray['api_source']);
|
unset($datarray['api_source']);
|
||||||
|
|
||||||
if ($origin) {
|
|
||||||
$signed = Diaspora::createCommentSignature($uid, $datarray);
|
|
||||||
if (!empty($signed)) {
|
|
||||||
$datarray['diaspora_signed_text'] = json_encode($signed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$post_id = Item::insert($datarray);
|
$post_id = Item::insert($datarray);
|
||||||
|
|
||||||
if (!$post_id) {
|
if (!$post_id) {
|
||||||
|
|
|
@ -1060,7 +1060,14 @@ class Item
|
||||||
Post\Content::insert($item['uri-id'], $item);
|
Post\Content::insert($item['uri-id'], $item);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Diaspora signature
|
// Create Diaspora signature
|
||||||
|
if ($item['origin'] && empty($item['diaspora_signed_text'])) {
|
||||||
|
$signed = Diaspora::createCommentSignature($uid, $item);
|
||||||
|
if (!empty($signed)) {
|
||||||
|
$item['diaspora_signed_text'] = json_encode($signed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($item['diaspora_signed_text'])) {
|
if (!empty($item['diaspora_signed_text'])) {
|
||||||
DBA::replace('diaspora-interaction', ['uri-id' => $item['uri-id'], 'interaction' => $item['diaspora_signed_text']]);
|
DBA::replace('diaspora-interaction', ['uri-id' => $item['uri-id'], 'interaction' => $item['diaspora_signed_text']]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4049,13 +4049,11 @@ class Diaspora
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$parent = Post::selectFirst(['parent-uri'], ['uri' => $item['thr-parent']]);
|
// This is only needed for the automated tests
|
||||||
if (!DBA::isResult($parent)) {
|
if (empty($owner['uprvkey'])) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$item['parent-uri'] = $parent['parent-uri'];
|
|
||||||
|
|
||||||
$message = self::constructComment($item, $owner);
|
$message = self::constructComment($item, $owner);
|
||||||
if ($message === false) {
|
if ($message === false) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue