don't include friend suggestions for people with the same name as current contacts. This will remove a lot of #whoaretonybaldwin.

This commit is contained in:
friendica 2012-03-25 21:43:17 -07:00
parent ba28362242
commit 021c647673

View file

@ -238,11 +238,13 @@ function suggestion_query($uid, $start = 0, $limit = 80) {
$r = q("SELECT count(glink.gcid) as `total`, gcontact.* from gcontact $r = q("SELECT count(glink.gcid) as `total`, gcontact.* from gcontact
left join glink on glink.gcid = gcontact.id 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 ) and not gcontact.id in ( select gcid from gcign where uid = %d )
group by glink.gcid order by total desc limit %d, %d ", group by glink.gcid order by total desc limit %d, %d ",
intval($uid), intval($uid),
intval($uid), intval($uid),
intval($uid), intval($uid),
intval($uid),
intval($start), intval($start),
intval($limit) intval($limit)
); );
@ -253,10 +255,12 @@ function suggestion_query($uid, $start = 0, $limit = 80) {
$r2 = q("SELECT gcontact.* from gcontact $r2 = q("SELECT gcontact.* from gcontact
left join glink on glink.gcid = gcontact.id 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 ) and not gcontact.id in ( select gcid from gcign where uid = %d )
order by rand() limit %d, %d ", order by rand() limit %d, %d ",
intval($uid), intval($uid),
intval($uid), intval($uid),
intval($uid),
intval($start), intval($start),
intval($limit) intval($limit)
); );