prevent duplicate friend suggestions
This commit is contained in:
		
					parent
					
						
							
								3aacc119a1
							
						
					
				
			
			
				commit
				
					
						3ae43c2448
					
				
			
		
					 2 changed files with 10 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -1898,6 +1898,14 @@ function local_delivery($importer,$data) {
 | 
			
		|||
		);
 | 
			
		||||
		if(count($r)) {
 | 
			
		||||
			$fid = $r[0]['id'];
 | 
			
		||||
 | 
			
		||||
			// OK, we do. Do we already have an introduction for this person ?
 | 
			
		||||
			$r = q("select id from intro where uid = %d and fid = %d limit 1",
 | 
			
		||||
				intval($fsugg['uid']),
 | 
			
		||||
				intval($fid)
 | 
			
		||||
			);
 | 
			
		||||
			if(count($r))
 | 
			
		||||
				return 0;
 | 
			
		||||
		}
 | 
			
		||||
		if(! $fid)
 | 
			
		||||
			$r = q("INSERT INTO `fcontact` ( `name`,`url`,`photo`,`request` ) VALUES ( '%s', '%s', '%s', '%s' ) ",
 | 
			
		||||
| 
						 | 
				
			
			@ -1918,6 +1926,7 @@ function local_delivery($importer,$data) {
 | 
			
		|||
		else
 | 
			
		||||
			return 0;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		$hash = random_string();
 | 
			
		||||
 
 | 
			
		||||
		$r = q("INSERT INTO `intro` ( `uid`, `fid`, `contact-id`, `note`, `hash`, `datetime`, `blocked` )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue