]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add some debugging stuff for problems with remote subscribe
authorEvan Prodromou <evan@prodromou.name>
Mon, 2 Jun 2008 18:12:54 +0000 (14:12 -0400)
committerEvan Prodromou <evan@prodromou.name>
Mon, 2 Jun 2008 18:12:54 +0000 (14:12 -0400)
darcs-hash:20080602181254-84dde-ac7f4a362754a66facfb06a7b41f9160a0eb5caf.gz

actions/remotesubscribe.php
lib/omb.php

index c2c633c16abc49528e7bf02dbcef5e7832773e15..f454a140078eb51150278f5b04ea071d653147d1 100644 (file)
@@ -129,23 +129,55 @@ class RemotesubscribeAction extends Action {
 
                # XXX: the following code could probably be refactored to eliminate dupes
                
+               common_debug('remotesubscribe.php - looking for oauth discovery service');
+               
                $oauth_service = $xrds->services(omb_service_filter(OAUTH_DISCOVERY));
                
                if (!$oauth_service) {
+                       common_debug('remotesubscribe.php - failed to find oauth discovery service');
                        return NULL;
                }
 
+               common_debug('remotesubscribe.php - looking for oauth discovery XRD');
+               
                $xrd = $this->getXRD($oauth_service, $xrds);
-               $this->addServices($xrd, $oauth_endpoints, $omb);
+               
+               if (!$xrd) {
+                       common_debug('remotesubscribe.php - failed to find oauth discovery XRD');
+                       return NULL;
+               }
+               
+               common_debug('remotesubscribe.php - adding OAuth services from XRD');
+               
+               if (!$this->addServices($xrd, $oauth_endpoints, $omb)) {
+                       common_debug('remotesubscribe.php - failed to add OAuth services');
+                       return NULL;
+               }
 
+               common_debug('remotesubscribe.php - looking for OMB discovery service');
+               
                $omb_service = $xrds->services(omb_service_filter(OMB_NAMESPACE));
 
                if (!$omb_service) {
+                       common_debug('remotesubscribe.php - failed to find OMB discovery service');
                        return NULL;
                }
 
+               common_debug('remotesubscribe.php - looking for OMB discovery XRD');
+               
                $xrd = $this->getXRD($omb_service, $xrds);
-               $this->addServices($xrd, $omb_endpoints, $omb);
+
+               if (!$xrd) {
+                       common_debug('remotesubscribe.php - failed to find OMB discovery XRD');
+                       return NULL;
+               }
+               
+               common_debug('remotesubscribe.php - adding OMB services from XRD');
+               
+               if (!$this->addServices($xrd, $omb_endpoints, $omb)) {
+                       common_debug('remotesubscribe.php - failed to add OMB services');
+                       return NULL;
+               }
                
                # XXX: check that we got all the services we needed
                
index 5f31de42c1c9cd1252428ba941bd736a20580996..ae7531ce8e1cba4bedf0982f0a906ae8352f70d4 100644 (file)
@@ -75,6 +75,9 @@ function omb_match_service($service, $type) {
 }
 
 function omb_service_uri($service) {
+       if (!$service) {
+               return NULL;
+       }
        $uris = $service->getURIs();
        if (!$uris) {
                return NULL;