From 10bea2f1200185e24fccc3aa7ab3e7936475e911 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 29 Dec 2017 20:02:15 +0000 Subject: [PATCH] Use the "real" receiver when possible --- src/Protocol/Diaspora.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index aa80460cdb..15a30f532e 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -3243,9 +3243,14 @@ class Diaspora // Fetch some user id to have a valid handle to transmit the participation. // In fact it doesn't matter which user sends this - but it is needed by the protocol. - $condition = ['verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]; - $first_user = dba::select('user', ['uid'], $condition, ['limit' => 1]); - $owner = User::getOwnerDataById($first_user['uid']); + // If the item belongs to a user, we take this user id. + if ($item['uid'] == 0) { + $condition = ['verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]; + $first_user = dba::select('user', ['uid'], $condition, ['limit' => 1]); + $owner = User::getOwnerDataById($first_user['uid']); + } else { + $owner = User::getOwnerDataById($item['uid']); + } $author = self::myHandle($owner);