From 03677f1a81bcde5541bda6322e0dd0b0fb847ecd Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 2 Jun 2008 13:42:49 -0400 Subject: better handling of XRDS files Our generated XRDS files contain 3 XRD elements: one for OAuth, one for OMB, and one to point to the other two. Auth_Yadis only gives us the last one, so we have to use it to find the other two, and then extract service URLs from them. Kind of fragile code, probably won't hold up under complicated topologies, and won't work at all if the XRDs are in another XRDS container. I tried to use XRDS filtering to get the top-priority version of XRDs, services, and URIs, but Laconica's output doesn't use any of that stuff and I don't particularly want to test it. darcs-hash:20080602174249-84dde-b7ffdf7f21afb5b734def70530fc305689da471d.gz --- lib/omb.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/omb.php b/lib/omb.php index 13a2f7adf..91c1906e3 100644 --- a/lib/omb.php +++ b/lib/omb.php @@ -59,4 +59,18 @@ function omb_hmac_sha1() { $hmac_method = new OAuthSignatureMethod_HMAC_SHA1(); } return $hmac_method; -} \ No newline at end of file +} + +function omb_service_uri($service) { + $uris = $service->getURIs(); + if (!$uris) { + return NULL; + } + return $uris[0]; +} + +function omb_local_id($service) { + $els = $service->getElements('LocalID'); + return ($els) ? $els[0] : NULL; +} + -- cgit v1.2.3-54-g00ecf