]> git.mxchange.org Git - friendica.git/commitdiff
Create the Diaspora signature for the correct user
authorMichael Vogel <icarus@dabo.de>
Thu, 5 Aug 2021 06:58:50 +0000 (08:58 +0200)
committerMichael Vogel <icarus@dabo.de>
Thu, 5 Aug 2021 06:58:50 +0000 (08:58 +0200)
include/conversation.php
src/Model/Item.php

index 6a6eff28dc2c2d0dded37fafa7de0eb5f3e43079..93ec728baaa9c870846278628a1dd90860df739a 100644 (file)
@@ -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          = [];
index a8105f78c3fb80ae5866e1782cb4f56cb2e5bdbd..0c48c9529189bc4d418eea659c6d8613cb28a8a4 100644 (file)
@@ -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);
                        }