aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-03-24 15:53:53 -0700
committerfriendica <info@friendica.com>2012-03-24 15:53:53 -0700
commit3ae43c24487450a749942ef4c3c19fa2a61461b6 (patch)
treeb5a5bc5881bf5b35cdb52bb997498ef36a391720
parent3aacc119a1d25f7ab4089482bbba7419c1357524 (diff)
downloadvolse-hubzilla-3ae43c24487450a749942ef4c3c19fa2a61461b6.tar.gz
volse-hubzilla-3ae43c24487450a749942ef4c3c19fa2a61461b6.tar.bz2
volse-hubzilla-3ae43c24487450a749942ef4c3c19fa2a61461b6.zip
prevent duplicate friend suggestions
-rwxr-xr-xboot.php2
-rwxr-xr-xinclude/items.php9
2 files changed, 10 insertions, 1 deletions
diff --git a/boot.php b/boot.php
index d2619e887..ea88cd39b 100755
--- a/boot.php
+++ b/boot.php
@@ -9,7 +9,7 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
-define ( 'FRIENDICA_VERSION', '2.3.1290' );
+define ( 'FRIENDICA_VERSION', '2.3.1291' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1133 );
diff --git a/include/items.php b/include/items.php
index 49e1ba97a..7b9b7315f 100755
--- a/include/items.php
+++ b/include/items.php
@@ -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` )