diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-09-12 21:25:37 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-09-12 21:25:37 -0700 |
commit | 2c96ad77396b0df2be481c4f90cc61ebaa83bc75 (patch) | |
tree | 7dc885cfadade7dbabf2645eae8117aef1042253 /include | |
parent | 19661d4c2599c25f8bcf536932e888a27e3663e1 (diff) | |
download | volse-hubzilla-2c96ad77396b0df2be481c4f90cc61ebaa83bc75.tar.gz volse-hubzilla-2c96ad77396b0df2be481c4f90cc61ebaa83bc75.tar.bz2 volse-hubzilla-2c96ad77396b0df2be481c4f90cc61ebaa83bc75.zip |
tag each side of the duplex
Diffstat (limited to 'include')
-rw-r--r-- | include/notifier.php | 17 | ||||
-rw-r--r-- | include/poller.php | 21 |
2 files changed, 33 insertions, 5 deletions
diff --git a/include/notifier.php b/include/notifier.php index a703dbee9..cc2846735 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -278,10 +278,19 @@ if((! strlen($rr['dfrn-id'])) && (! $rr['duplex'])) continue; - $idtosend = (($rr['dfrn-id']) ? $rr['dfrn-id'] : $rr['issued-id']); + + $idtosend = $orig_id = (($rr['dfrn-id']) ? $rr['dfrn-id'] : $rr['issued-id']); + + if($rr['duplex'] && $rr['dfrn-id']) + $idtosend = '0:' . $orig_id; + if($rr['duplex'] && $rr['issued-id']) + $idtosend = '1:' . $orig_id; $url = $rr['notify'] . '?dfrn_id=' . $idtosend; + if($debugging) + echo "URL: $url"; + $xml = fetch_url($url); if($debugging) @@ -312,7 +321,11 @@ } $final_dfrn_id = substr($final_dfrn_id, 0, strpos($final_dfrn_id, '.')); - if($final_dfrn_id != $idtosend) { + + if(strpos($final_dfrn_id,':') == 1) + $final_dfrn_id = substr($final_dfrn_id,2); + + if($final_dfrn_id != $orig_id) { // did not decode properly - cannot trust this site continue; } diff --git a/include/poller.php b/include/poller.php index dc2710ef0..c4d697e24 100644 --- a/include/poller.php +++ b/include/poller.php @@ -79,10 +79,16 @@ ? datetime_convert('UTC','UTC','now - 30 days','Y-m-d\TH:i:s\Z') : datetime_convert('UTC','UTC',$contact['last-update'],'Y-m-d\TH:i:s\Z')); - $idtosend = (($contact['dfrn-id']) ? $contact['dfrn-id'] : $contact['issued-id']); - $url = $contact['poll'] . '?dfrn_id=' . $idtosend . '&type=data&last_update=' . $last_update ; + $idtosend = $orig_id = (($contact['dfrn-id']) ? $contact['dfrn-id'] : $contact['issued-id']); + + if(intval($contact['duplex']) && $contact['dfrn-id']) + $idtosend = '0:' . $orig_id; + if(intval($contact['duplex']) && $contact['issued-id']) + $idtosend = '1:' . $orig_id; + + $url = $contact['poll'] . '?dfrn_id=' . $idtosend . '&type=data&last_update=' . $last_update ; $xml = fetch_url($url); if($debugging) { @@ -93,6 +99,8 @@ if(! $xml) continue; + + $res = simplexml_load_string($xml); if(intval($res->status) == 1) @@ -122,13 +130,20 @@ } $final_dfrn_id = substr($final_dfrn_id, 0, strpos($final_dfrn_id, '.')); - if($final_dfrn_id != $idtosend) { + + if(strpos($final_dfrn_id,':') == 1) + $final_dfrn_id = substr($final_dfrn_id,2); + + if($final_dfrn_id != $orig_id) { + // did not decode properly - cannot trust this site continue; } $postvars['dfrn_id'] = $idtosend; + + $xml = post_url($contact['poll'],$postvars); if($debugging) { |