aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorSimon L'nu <simon.lnu@gmail.com>2012-03-24 19:38:54 -0400
committerSimon L'nu <simon.lnu@gmail.com>2012-03-24 19:38:54 -0400
commit8a6c407282fe10f676f08f21e28647a5c8794e11 (patch)
treeb5a5bc5881bf5b35cdb52bb997498ef36a391720 /include/items.php
parent803f79e0912c4a526a16fdda4809277d8ad3195d (diff)
parent3ae43c24487450a749942ef4c3c19fa2a61461b6 (diff)
downloadvolse-hubzilla-8a6c407282fe10f676f08f21e28647a5c8794e11.tar.gz
volse-hubzilla-8a6c407282fe10f676f08f21e28647a5c8794e11.tar.bz2
volse-hubzilla-8a6c407282fe10f676f08f21e28647a5c8794e11.zip
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master: prevent duplicate friend suggestions block filed items from deletion add the bang network filter is now a permission group small fix in css add right_aside to diabook-blue add connectable services to right_aside add PostIt to right_aside, fixes in css * master:
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php
index b96f88566..7b9b7315f 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1437,7 +1437,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
}
if($deleted && is_array($contact)) {
$r = q("SELECT `item`.*, `contact`.`self` FROM `item` left join `contact` on `item`.`contact-id` = `contact`.`id`
- WHERE `uri` = '%s' AND `item`.`uid` = %d AND `contact-id` = %d LIMIT 1",
+ WHERE `uri` = '%s' AND `item`.`uid` = %d AND `contact-id` = %d AND NOT `item`.`file` LIKE '%%[%%' LIMIT 1",
dbesc($uri),
intval($importer['uid']),
intval($contact['id'])
@@ -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` )
@@ -2038,7 +2047,7 @@ function local_delivery($importer,$data) {
if($deleted) {
$r = q("SELECT `item`.*, `contact`.`self` FROM `item` left join contact on `item`.`contact-id` = `contact`.`id`
- WHERE `uri` = '%s' AND `item`.`uid` = %d AND `contact-id` = %d LIMIT 1",
+ WHERE `uri` = '%s' AND `item`.`uid` = %d AND `contact-id` = %d AND NOT `item`.`file` LIKE '%%[%%' LIMIT 1",
dbesc($uri),
intval($importer['importer_uid']),
intval($importer['id'])