aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dfrn_confirm.php
diff options
context:
space:
mode:
authorSimon L'nu <simon.lnu@gmail.com>2012-02-29 06:56:59 -0500
committerSimon L'nu <simon.lnu@gmail.com>2012-02-29 06:56:59 -0500
commit68554741465e92fe2e462b8de4470ddd0eb91302 (patch)
tree97fe9b7eb83b696688f3eec9cffb4dc57d2a0901 /mod/dfrn_confirm.php
parent21d1dc48a8e83e55c55d894f85b742ef667553d7 (diff)
parentfb33b4f2bcd18e63d311e6dba3aaa2ea5efdec3b (diff)
downloadvolse-hubzilla-68554741465e92fe2e462b8de4470ddd0eb91302.tar.gz
volse-hubzilla-68554741465e92fe2e462b8de4470ddd0eb91302.tar.bz2
volse-hubzilla-68554741465e92fe2e462b8de4470ddd0eb91302.zip
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master: Update LICENSE Update README cleaned up mess created when both people request friendship and one approves as duplex call time pass by reference deprecated From Tobias H - catch some irregularities caused by cut/paste code * 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.