aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dfrn_request.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2011-12-12 20:13:12 -0800
committerfriendica <info@friendica.com>2011-12-12 20:13:12 -0800
commited725df5f1c1ea2484c689283e93f8f825591384 (patch)
tree289183e66da097acfeaeb0c7bfe9099a87a5a86a /mod/dfrn_request.php
parent50c4b9a7803c08d6e41fc64ca3ffeb66c7f450ba (diff)
parentee4975f1cd9f205e2300f3e22e51079c5e26f155 (diff)
downloadvolse-hubzilla-ed725df5f1c1ea2484c689283e93f8f825591384.tar.gz
volse-hubzilla-ed725df5f1c1ea2484c689283e93f8f825591384.tar.bz2
volse-hubzilla-ed725df5f1c1ea2484c689283e93f8f825591384.zip
Merge branch 'master' into notify
Diffstat (limited to 'mod/dfrn_request.php')
-rw-r--r--mod/dfrn_request.php32
1 files changed, 31 insertions, 1 deletions
diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php
index 9755895ce..d7c918490 100644
--- a/mod/dfrn_request.php
+++ b/mod/dfrn_request.php
@@ -252,12 +252,41 @@ function dfrn_request_post(&$a) {
*
* Cleanup old introductions that remain blocked.
* Also remove the contact record, but only if there is no existing relationship
+ * Do not remove email contacts as these may be awaiting email verification
+ */
+
+ $r = q("SELECT `intro`.*, `intro`.`id` AS `iid`, `contact`.`id` AS `cid`, `contact`.`rel`
+ FROM `intro` LEFT JOIN `contact` on `intro`.`contact-id` = `contact`.`id`
+ WHERE `intro`.`blocked` = 1 AND `contact`.`self` = 0
+ AND `contact`.`network` != '%s'
+ AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 30 MINUTE ",
+ dbesc(NETWORK_MAIL)
+ );
+ if(count($r)) {
+ foreach($r as $rr) {
+ if(! $rr['rel']) {
+ q("DELETE FROM `contact` WHERE `id` = %d LIMIT 1",
+ intval($rr['cid'])
+ );
+ }
+ q("DELETE FROM `intro` WHERE `id` = %d LIMIT 1",
+ intval($rr['iid'])
+ );
+ }
+ }
+
+ /**
*
+ * Cleanup any old email intros - which will have a greater lifetime
*/
$r = q("SELECT `intro`.*, `intro`.`id` AS `iid`, `contact`.`id` AS `cid`, `contact`.`rel`
FROM `intro` LEFT JOIN `contact` on `intro`.`contact-id` = `contact`.`id`
- WHERE `intro`.`blocked` = 1 AND `contact`.`self` = 0 AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 30 MINUTE ");
+ WHERE `intro`.`blocked` = 1 AND `contact`.`self` = 0
+ AND `contact`.`network` = '%s'
+ AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 3 DAY ",
+ dbesc(NETWORK_MAIL)
+ );
if(count($r)) {
foreach($r as $rr) {
if(! $rr['rel']) {
@@ -271,6 +300,7 @@ function dfrn_request_post(&$a) {
}
}
+
$url = trim($_POST['dfrn_url']);
if(! strlen($url)) {
notice( t("Invalid locator") . EOL );