diff options
author | Michael <icarus@dabo.de> | 2012-03-02 10:34:18 +0100 |
---|---|---|
committer | Michael <icarus@dabo.de> | 2012-03-02 10:34:18 +0100 |
commit | 20817b4b8ea8b7d074d57a3fd752862931cf711c (patch) | |
tree | fd0344bd209043c4d8191ef68dceb1499cf7dd9a /mod/dfrn_confirm.php | |
parent | 52ea842e872cc004fd012496c828e9fb6186bec9 (diff) | |
parent | f1bf6dcdfb89bf3c21e498ba3d76c600dafed934 (diff) | |
download | volse-hubzilla-20817b4b8ea8b7d074d57a3fd752862931cf711c.tar.gz volse-hubzilla-20817b4b8ea8b7d074d57a3fd752862931cf711c.tar.bz2 volse-hubzilla-20817b4b8ea8b7d074d57a3fd752862931cf711c.zip |
Merge remote branch 'upstream/master'
Diffstat (limited to 'mod/dfrn_confirm.php')
-rw-r--r-- | mod/dfrn_confirm.php | 12 |
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. |