From fe348acb49e9c80028fe6618f10f8b894510a84b Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Wed, 29 Nov 2017 20:59:06 +0000
Subject: [PATCH] Small fixes to "nogroup"

---
 mod/nogroup.php        |  2 +-
 src/Object/Contact.php | 12 +++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/mod/nogroup.php b/mod/nogroup.php
index a66a70a1e0..5fb9afc2ac 100644
--- a/mod/nogroup.php
+++ b/mod/nogroup.php
@@ -55,7 +55,7 @@ function nogroup_content(App $a)
 				'about'         => $contact_details['about'],
 				'sparkle' => $sparkle,
 				'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
-				'url' => $url,
+				'url' => $rr['url'],
 				'network' => network_to_name($rr['network'], $url),
 			);
 		}
diff --git a/src/Object/Contact.php b/src/Object/Contact.php
index d7e7853621..919113672e 100644
--- a/src/Object/Contact.php
+++ b/src/Object/Contact.php
@@ -477,12 +477,14 @@ class Contact extends BaseObject
 				"SELECT COUNT(*) AS `total`
 				 FROM `contact`
 				 WHERE `uid` = %d
-				 AND `self` = 0
+				 AND NOT `self`
+				 AND NOT `blocked`
+				 AND NOT `pending`
 				 AND `id` NOT IN (
 					SELECT DISTINCT(`contact-id`)
 					FROM `group_member`
 					WHERE `uid` = %d
-				) ", intval($uid), intval($uid)
+				)", intval($uid), intval($uid)
 			);
 
 			return $r;
@@ -492,13 +494,13 @@ class Contact extends BaseObject
 			"SELECT *
 			FROM `contact`
 			WHERE `uid` = %d
-			AND `self` = 0
+			AND NOT `self`
+			AND NOT `blocked`
+			AND NOT `pending`
 			AND `id` NOT IN (
 				SELECT DISTINCT(`contact-id`)
 				FROM `group_member` WHERE `uid` = %d
 			)
-			AND `blocked` = 0
-			AND `pending` = 0
 			LIMIT %d, %d", intval($uid), intval($uid), intval($start), intval($count)
 		);
 		return $r;