From e37cf8fea26683ed2223ff2fcc4d7fdccc9f74aa Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 17 Dec 2017 16:10:44 -0500 Subject: [PATCH] Fix missing owner in Protocol/Diaspora --- src/Protocol/Diaspora.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 5bfebe9f7..e15c1b793 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -4051,6 +4051,29 @@ class Diaspora return; } + $r = dba::p("SELECT + `contact`.*, + `user`.`prvkey` AS `uprvkey`, + `user`.`timezone`, + `user`.`nickname`, + `user`.`sprvkey`, + `user`.`spubkey`, + `user`.`page-flags`, + `user`.`account-type`, + `user`.`prvnets` + FROM `contact` + INNER JOIN `user` + ON `user`.`uid` = `contact`.`uid` + WHERE `contact`.`uid` = ? + AND `contact`.`self` = 1 + LIMIT 1", + $uid + ); + if (!DBM::is_result($r)) { + return; + } + $owner = $r[0]; + if (!$recips) { $recips = q( "SELECT `id`,`name`,`network`,`pubkey`,`notify` FROM `contact` WHERE `network` = '%s' @@ -4069,8 +4092,7 @@ class Diaspora foreach ($recips as $recip) { logger("Send updated profile data for user ".$uid." to contact ".$recip["id"], LOGGER_DEBUG); - /// @fixme $profile isn't available here - self::buildAndTransmit($profile, $recip, "profile", $message, false, "", true); + self::buildAndTransmit($owner, $recip, "profile", $message, false, "", true); } }