aboutsummaryrefslogtreecommitdiffstats
path: root/include/poller.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-09-12 21:25:37 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-09-12 21:25:37 -0700
commit2c96ad77396b0df2be481c4f90cc61ebaa83bc75 (patch)
tree7dc885cfadade7dbabf2645eae8117aef1042253 /include/poller.php
parent19661d4c2599c25f8bcf536932e888a27e3663e1 (diff)
downloadvolse-hubzilla-2c96ad77396b0df2be481c4f90cc61ebaa83bc75.tar.gz
volse-hubzilla-2c96ad77396b0df2be481c4f90cc61ebaa83bc75.tar.bz2
volse-hubzilla-2c96ad77396b0df2be481c4f90cc61ebaa83bc75.zip
tag each side of the duplex
Diffstat (limited to 'include/poller.php')
-rw-r--r--include/poller.php21
1 files changed, 18 insertions, 3 deletions
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) {