]> git.mxchange.org Git - friendica.git/commitdiff
Don't suggest hidden contacts / Added AP to the suggestions
authorMichael <heluecht@pirati.ca>
Tue, 13 Nov 2018 05:52:21 +0000 (05:52 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 13 Nov 2018 05:52:21 +0000 (05:52 +0000)
mod/dirfind.php
src/Model/GContact.php

index d3298b64db4a3201aff15fe498ae49dda59429c1..2609760e91df0fc50d86c1935699ec586a8a624a 100644 (file)
@@ -121,23 +121,23 @@ function dirfind_content(App $a, $prefix = "") {
 
                        /// @TODO These 2 SELECTs are not checked on validity with DBA::isResult()
                        $count = q("SELECT count(*) AS `total` FROM `gcontact`
-                                       WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s') AND
+                                       WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s', '%s') AND
                                                ((`last_contact` >= `last_failure`) OR (`updated` >= `last_failure`)) AND
                                                (`url` LIKE '%s' OR `name` LIKE '%s' OR `location` LIKE '%s' OR
                                                `addr` LIKE '%s' OR `about` LIKE '%s' OR `keywords` LIKE '%s') $extra_sql",
-                                       DBA::escape(Protocol::DFRN), DBA::escape($ostatus), DBA::escape($diaspora),
+                                       DBA::escape(Protocol::ACTIVITYPUB), DBA::escape(Protocol::DFRN), DBA::escape($ostatus), DBA::escape($diaspora),
                                        DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)),
                                        DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)));
 
                        $results = q("SELECT `nurl`
                                        FROM `gcontact`
-                                       WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s') AND
+                                       WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s', '%s') AND
                                                ((`last_contact` >= `last_failure`) OR (`updated` >= `last_failure`)) AND
                                                (`url` LIKE '%s' OR `name` LIKE '%s' OR `location` LIKE '%s' OR
                                                `addr` LIKE '%s' OR `about` LIKE '%s' OR `keywords` LIKE '%s') $extra_sql
                                                GROUP BY `nurl`
                                                ORDER BY `updated` DESC LIMIT %d, %d",
-                                       DBA::escape(Protocol::DFRN), DBA::escape($ostatus), DBA::escape($diaspora),
+                                       DBA::escape(Protocol::ACTIVITYPUB), DBA::escape(Protocol::DFRN), DBA::escape($ostatus), DBA::escape($diaspora),
                                        DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)),
                                        DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)),
                                        $pager->getStart(), $pager->getItemsPerPage());
index 6e2e520c89f58239f4cd3088412a002dc72b11ce..1fed1fc3ef5b8464f521814dc99b3976b17a9ec9 100644 (file)
@@ -430,7 +430,7 @@ class GContact
                //      return $list;
                //}
 
-               $network = [Protocol::DFRN];
+               $network = [Protocol::DFRN, Protocol::ACTIVITYPUB];
 
                if (Config::get('system', 'diaspora_enabled')) {
                        $network[] = Protocol::DIASPORA;
@@ -451,7 +451,7 @@ class GContact
                        where uid = %d and not gcontact.nurl in ( select nurl from contact where uid = %d )
                        AND NOT `gcontact`.`name` IN (SELECT `name` FROM `contact` WHERE `uid` = %d)
                        AND NOT `gcontact`.`id` IN (SELECT `gcid` FROM `gcign` WHERE `uid` = %d)
-                       AND `gcontact`.`updated` >= '%s'
+                       AND `gcontact`.`updated` >= '%s' AND NOT `gcontact`.`hide`
                        AND `gcontact`.`last_contact` >= `gcontact`.`last_failure`
                        AND `gcontact`.`network` IN (%s)
                        GROUP BY `glink`.`gcid` ORDER BY `gcontact`.`updated` DESC,`total` DESC LIMIT %d, %d",