From a74b5fdde81a0510b0fa7ad02f03a8539fc8dd33 Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Thu, 22 Feb 2018 09:59:21 +0000
Subject: [PATCH] When refreshing the fcontact, the returned array was
 incomplete

---
 src/Protocol/Diaspora.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php
index 2efde817e8..1578edb920 100644
--- a/src/Protocol/Diaspora.php
+++ b/src/Protocol/Diaspora.php
@@ -826,7 +826,12 @@ class Diaspora
 			// if Diaspora connectivity is enabled on their server
 			if ($r && ($r["network"] === NETWORK_DIASPORA)) {
 				self::addFContact($r, $update);
-				$person = $r;
+
+				// Fetch the updated or added contact
+				$person = dba::selectFirst('fcontact', [], ['network' => NETWORK_DIASPORA, 'addr' => $handle]);
+				if (!DBM::is_result($person)) {
+					$person = $r;
+				}
 			}
 		}
 
-- 
2.39.5