Use the "real" receiver when possible

This commit is contained in:
Michael 2017-12-29 20:02:15 +00:00
parent d3b626a266
commit 10bea2f120

View file

@ -3243,9 +3243,14 @@ class Diaspora
// Fetch some user id to have a valid handle to transmit the participation. // 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. // In fact it doesn't matter which user sends this - but it is needed by the protocol.
// 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]; $condition = ['verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false];
$first_user = dba::select('user', ['uid'], $condition, ['limit' => 1]); $first_user = dba::select('user', ['uid'], $condition, ['limit' => 1]);
$owner = User::getOwnerDataById($first_user['uid']); $owner = User::getOwnerDataById($first_user['uid']);
} else {
$owner = User::getOwnerDataById($item['uid']);
}
$author = self::myHandle($owner); $author = self::myHandle($owner);