From: Michael Vogel Date: Sun, 10 Jul 2016 11:11:09 +0000 (+0200) Subject: Diaspora: Send the profile data after a successful connect X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9ac26802ced0f620b424f96a901a306af1dce722;p=friendica.git Diaspora: Send the profile data after a successful connect --- diff --git a/include/diaspora.php b/include/diaspora.php index a23a7d278b..73c243e0b3 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -1981,6 +1981,9 @@ class diaspora { if($u) { logger("Sending share message (Relation: ".$new_relation.") to author ".$author." - Contact: ".$contact_record["id"]." - User: ".$importer["uid"], LOGGER_DEBUG); $ret = self::send_share($u[0], $contact_record); + + // Send the profile data, maybe it weren't transmitted before + self::send_profile($importer["uid"], array($contact_record)); } } @@ -3204,17 +3207,18 @@ class diaspora { * * @param int $uid The user id */ - public static function send_profile($uid) { + public static function send_profile($uid, $recips = false) { if (!$uid) return; - $recips = q("SELECT `id`,`name`,`network`,`pubkey`,`notify` FROM `contact` WHERE `network` = '%s' - AND `uid` = %d AND `rel` != %d", - dbesc(NETWORK_DIASPORA), - intval($uid), - intval(CONTACT_IS_SHARING) - ); + if (!$recips) + $recips = q("SELECT `id`,`name`,`network`,`pubkey`,`notify` FROM `contact` WHERE `network` = '%s' + AND `uid` = %d AND `rel` != %d", + dbesc(NETWORK_DIASPORA), + intval($uid), + intval(CONTACT_IS_SHARING) + ); if (!$recips) return; @@ -3278,8 +3282,10 @@ class diaspora { "searchable" => $searchable, "tag_string" => $tags); - foreach($recips as $recip) + foreach($recips as $recip) { + logger("Send updated profile data for user ".$uid." to contact ".$recip["id"], LOGGER_DEBUG); self::build_and_transmit($profile, $recip, "profile", $message, false, "", true); + } } /**