Merge pull request #5897 from annando/fix-diaspora-signature

The virtual fields for the diaspora signatures have to be removed at any time
This commit is contained in:
Hypolite Petovan 2018-10-12 19:58:10 -04:00 committed by GitHub
commit af8a383be0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View file

@ -1289,17 +1289,16 @@ class Item extends BaseObject
*/ */
$dsprsig = null; $dsprsig = null;
if (x($item, 'dsprsig')) { if (isset($item['dsprsig'])) {
$encoded_signature = $item['dsprsig']; $encoded_signature = $item['dsprsig'];
$dsprsig = json_decode(base64_decode($item['dsprsig'])); $dsprsig = json_decode(base64_decode($item['dsprsig']));
unset($item['dsprsig']); unset($item['dsprsig']);
} }
if (!empty($item['diaspora_signed_text'])) { $diaspora_signed_text = '';
if (isset($item['diaspora_signed_text'])) {
$diaspora_signed_text = $item['diaspora_signed_text']; $diaspora_signed_text = $item['diaspora_signed_text'];
unset($item['diaspora_signed_text']); unset($item['diaspora_signed_text']);
} else {
$diaspora_signed_text = '';
} }
// Converting the plink // Converting the plink
@ -1488,6 +1487,7 @@ class Item extends BaseObject
$deny_gid = ''; $deny_gid = '';
if ($item['parent-uri'] === $item['uri']) { if ($item['parent-uri'] === $item['uri']) {
$diaspora_signed_text = '';
$parent_id = 0; $parent_id = 0;
$parent_deleted = 0; $parent_deleted = 0;
$allow_cid = $item['allow_cid']; $allow_cid = $item['allow_cid'];
@ -1534,6 +1534,10 @@ class Item extends BaseObject
$item['wall'] = $parent['wall']; $item['wall'] = $parent['wall'];
$notify_type = 'comment-new'; $notify_type = 'comment-new';
if (!$parent['origin']) {
$diaspora_signed_text = '';
}
/* /*
* If the parent is private, force privacy for the entire conversation * If the parent is private, force privacy for the entire conversation
* This differs from the above settings as it subtly allows comments from * This differs from the above settings as it subtly allows comments from
@ -1574,6 +1578,7 @@ class Item extends BaseObject
$parent_id = 0; $parent_id = 0;
$item['parent-uri'] = $item['uri']; $item['parent-uri'] = $item['uri'];
$item['gravity'] = GRAVITY_PARENT; $item['gravity'] = GRAVITY_PARENT;
$diaspora_signed_text = '';
} else { } else {
logger('item parent '.$item['parent-uri'].' for '.$item['uid'].' was not found - ignoring item'); logger('item parent '.$item['parent-uri'].' for '.$item['uid'].' was not found - ignoring item');
return 0; return 0;

View file

@ -215,6 +215,7 @@ class Processor
$item['tag'] = self::constructTagList($activity['tags'], $activity['sensitive']); $item['tag'] = self::constructTagList($activity['tags'], $activity['sensitive']);
$item['app'] = $activity['service']; $item['app'] = $activity['service'];
$item['plink'] = defaults($activity, 'alternate-url', $item['uri']); $item['plink'] = defaults($activity, 'alternate-url', $item['uri']);
$item['diaspora_signed_text'] = defaults($activity, 'diaspora:comment', '');
$item = self::constructAttachList($activity['attachments'], $item); $item = self::constructAttachList($activity['attachments'], $item);