aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dfrn_confirm.php
diff options
context:
space:
mode:
authorAlexander Kampmann <programmer@nurfuerspam.de>2012-03-01 11:49:22 +0100
committerAlexander Kampmann <programmer@nurfuerspam.de>2012-03-01 11:49:22 +0100
commitdd9432903ddb3e12381881da44fb84afff832d52 (patch)
treeb499e77cd4faf8157c2e048fb8242bc2ca2720cc /mod/dfrn_confirm.php
parente0c659b34b8992111bcc64d3f0eea75dfa193412 (diff)
parentbd2c8c92f1b30d8f811bd4aab0fe3a2c5496ec61 (diff)
downloadvolse-hubzilla-dd9432903ddb3e12381881da44fb84afff832d52.tar.gz
volse-hubzilla-dd9432903ddb3e12381881da44fb84afff832d52.tar.bz2
volse-hubzilla-dd9432903ddb3e12381881da44fb84afff832d52.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod/dfrn_confirm.php')
-rw-r--r--mod/dfrn_confirm.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php
index 5a24f0089..0bc3ea7df 100644
--- a/mod/dfrn_confirm.php
+++ b/mod/dfrn_confirm.php
@@ -107,7 +107,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
*
*/
- $r = q("SELECT * FROM `contact` WHERE ( ( `issued-id` != '' AND `issued-id` = '%s' ) OR ( `id` = %d AND `id` != 0 ) ) AND `uid` = %d LIMIT 1",
+ $r = q("SELECT * FROM `contact` WHERE ( ( `issued-id` != '' AND `issued-id` = '%s' ) OR ( `id` = %d AND `id` != 0 ) ) AND `uid` = %d AND `duplex` = 0 LIMIT 1",
dbesc($dfrn_id),
intval($cid),
intval($uid)
@@ -116,6 +116,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
if(! count($r)) {
logger('dfrn_confirm: Contact not found in DB.');
notice( t('Contact not found.') . EOL );
+ notice( t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL );
return;
}
@@ -631,6 +632,15 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
xml_status(3,$message);
}
+ // It's possible that the other person also requested friendship.
+ // If it is a duplex relationship, ditch the issued-id if one exists.
+
+ if($duplex) {
+ $r = q("UPDATE `contact` SET `issued-id` = '' WHERE `id` = %d LIMIT 1",
+ intval($dfrn_record)
+ );
+ }
+
// We're good but now we have to scrape the profile photo and send notifications.