X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FItem.php;h=f6bec1561cb0f0ed0e6e010a74bb1e75f133d73c;hb=8a9f633ce26d4fcb74557891282572b372d5d223;hp=b7267428ab4f563af587d3e8ddb74b469d3ab3f9;hpb=4564d167dbd15f5d0da2b1bdef4b337efd3a36a2;p=friendica.git diff --git a/src/Model/Item.php b/src/Model/Item.php index b7267428ab..f6bec1561c 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1060,7 +1060,14 @@ class Item Post\Content::insert($item['uri-id'], $item); } - // Diaspora signature + // Create Diaspora signature + if ($item['origin'] && empty($item['diaspora_signed_text']) && ($item['gravity'] != GRAVITY_PARENT)) { + $signed = Diaspora::createCommentSignature($uid, $item); + if (!empty($signed)) { + $item['diaspora_signed_text'] = json_encode($signed); + } + } + if (!empty($item['diaspora_signed_text'])) { DBA::replace('diaspora-interaction', ['uri-id' => $item['uri-id'], 'interaction' => $item['diaspora_signed_text']]); } @@ -1220,13 +1227,10 @@ class Item Logger::info('The resharer is no forum: quit', ['resharer' => $item['author-id'], 'owner' => $parent['owner-id'], 'author' => $parent['author-id'], 'uid' => $item['uid']]); return; } - self::update(['post-reason' => self::PR_ANNOUNCEMENT, 'causer-id' => $item['author-id']], ['id' => $parent['id']]); - Logger::info('Set announcement post-reason', ['uri-id' => $item['uri-id'], 'thr-parent-id' => $item['thr-parent-id'], 'uid' => $item['uid']]); - return; } - self::update(['owner-id' => $item['author-id'], 'contact-id' => $cid], ['id' => $parent['id']]); - Logger::info('Change owner of the parent', ['uri-id' => $item['uri-id'], 'thr-parent-id' => $item['thr-parent-id'], 'uid' => $item['uid'], 'owner-id' => $item['author-id'], 'contact-id' => $cid]); + self::update(['post-reason' => self::PR_ANNOUNCEMENT, 'causer-id' => $item['author-id']], ['id' => $parent['id']]); + Logger::info('Set announcement post-reason', ['uri-id' => $item['uri-id'], 'thr-parent-id' => $item['thr-parent-id'], 'uid' => $item['uid']]); } /** @@ -2878,7 +2882,7 @@ class Item 'mime' => $attachment['mimetype'], ], ]); - if ($item['post-type'] == Item::PT_AUDIO) { + if (($item['post-type'] ?? null) == Item::PT_AUDIO) { $leading .= $media; } else { $trailing .= $media;