From 3d13db1f2c5123353616de01911becdf4876f57f Mon Sep 17 00:00:00 2001
From: Hypolite Petovan <hypolite@mrpetovan.com>
Date: Tue, 22 Aug 2023 08:38:12 -0400
Subject: [PATCH] Skip server ignored check when contact gsid is empty in
 Module\Contact\Profile

---
 src/Module/Contact/Profile.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/Module/Contact/Profile.php b/src/Module/Contact/Profile.php
index 399198062b..d6f5a90ce8 100644
--- a/src/Module/Contact/Profile.php
+++ b/src/Module/Contact/Profile.php
@@ -267,7 +267,13 @@ class Profile extends BaseModule
 
 		$insecure = $this->t('Private communications are not available for this contact.');
 
+		// @TODO: Figure out why gsid can be empty
+		if (empty($contact['gsid'])) {
+			$this->logger->notice('Empty gsid for contact', ['contact' => $contact]);
+		}
+
 		$serverIgnored =
+			$contact['gsid'] &&
 			$this->userGServer->isIgnoredByUser($this->session->getLocalUserId(), $contact['gsid']) ?
 				$this->t('This contact is on a server you ignored.')
 				: '';
-- 
2.39.5