From c73130aa6b83951b9e6ecc05c66d25292b5b9091 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 5 Aug 2021 08:58:50 +0200 Subject: [PATCH] Create the Diaspora signature for the correct user --- include/conversation.php | 2 +- src/Model/Item.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 6a6eff28dc..93ec728baa 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -717,7 +717,7 @@ function conversation_add_children(array $parents, $block_authors, $order, $uid) $max_comments = DI::config()->get('system', 'max_display_comments', 1000); } - $params = ['order' => ['uri-id' => true]]; + $params = ['order' => ['uri-id' => true, 'uid' => true]]; $activities = []; $uriids = []; diff --git a/src/Model/Item.php b/src/Model/Item.php index a8105f78c3..0c48c95291 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1061,7 +1061,13 @@ class Item // Create Diaspora signature if ($item['origin'] && empty($item['diaspora_signed_text']) && ($item['gravity'] != GRAVITY_PARENT)) { - $signed = Diaspora::createCommentSignature($uid, $item); + if ($uid == 0) { + $sender_contact = Contact::getById($item['contact-id'], ['uid']); + $sender_uid = $sender_contact['uid']; + } else { + $sender_uid = $uid; + } + $signed = Diaspora::createCommentSignature($sender_uid, $item); if (!empty($signed)) { $item['diaspora_signed_text'] = json_encode($signed); }