aboutsummaryrefslogtreecommitdiffstats
path: root/include/socgraph.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-03-25 21:43:17 -0700
committerfriendica <info@friendica.com>2012-03-25 21:43:17 -0700
commit021c64767350d9ae2d95b57de5b6250c729b3dc6 (patch)
tree94b059574bd57c91accbf9df213b13ad16be3cf7 /include/socgraph.php
parentba28362242c18ff9ab8c5c03785cd4196642ea73 (diff)
downloadvolse-hubzilla-021c64767350d9ae2d95b57de5b6250c729b3dc6.tar.gz
volse-hubzilla-021c64767350d9ae2d95b57de5b6250c729b3dc6.tar.bz2
volse-hubzilla-021c64767350d9ae2d95b57de5b6250c729b3dc6.zip
don't include friend suggestions for people with the same name as current contacts. This will remove a lot of #whoaretonybaldwin.
Diffstat (limited to 'include/socgraph.php')
-rwxr-xr-xinclude/socgraph.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/socgraph.php b/include/socgraph.php
index b2f545509..3f5194049 100755
--- a/include/socgraph.php
+++ b/include/socgraph.php
@@ -237,12 +237,14 @@ function suggestion_query($uid, $start = 0, $limit = 80) {
$r = q("SELECT count(glink.gcid) as `total`, gcontact.* from gcontact
left join glink on glink.gcid = gcontact.id
- where uid = %d and not gcontact.nurl in ( select nurl from contact where uid = %d)
+ 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 )
group by glink.gcid order by total desc limit %d, %d ",
intval($uid),
intval($uid),
intval($uid),
+ intval($uid),
intval($start),
intval($limit)
);
@@ -252,11 +254,13 @@ function suggestion_query($uid, $start = 0, $limit = 80) {
$r2 = q("SELECT gcontact.* from gcontact
left join glink on glink.gcid = gcontact.id
- where glink.uid = 0 and glink.cid = 0 and not gcontact.nurl in ( select nurl from contact where uid = %d)
+ where glink.uid = 0 and glink.cid = 0 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 )
order by rand() limit %d, %d ",
intval($uid),
intval($uid),
+ intval($uid),
intval($start),
intval($limit)
);