Remove all public references to the appID/OAuthConsumer object
authorAndy Allan <gravitystorm@gmail.com>
Tue, 19 Oct 2010 10:10:30 +0000 (10:10 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Tue, 19 Oct 2010 10:10:30 +0000 (10:10 +0000)
net/systemeD/halcyon/connection/Connection.as
net/systemeD/halcyon/connection/XMLConnection.as
net/systemeD/potlatch2/save/SaveManager.as

index bebd589..a73f876 100755 (executable)
@@ -360,7 +360,6 @@ package net.systemeD.halcyon.connection {
                                                                top:Number, bottom:Number):void {
            }
            
-           public function setAppID(id:Object):void {}
            public function setAuthToken(id:Object):void {}
            public function createChangeset(tags:Object):void {}
                public function closeChangeset():void {}
@@ -368,7 +367,6 @@ package net.systemeD.halcyon.connection {
         public function fetchUserTraces(refresh:Boolean=false):void {}
         public function fetchTrace(id:Number, callback:Function):void {}
         public function getAccessToken(data:Object):OAuthToken { return null; } //todo make private and remove import org.ioshtan etc
-        public function getConsumer():OAuthConsumer { return null; }
     }
 
 }
index da9650d..28a3577 100644 (file)
@@ -51,11 +51,7 @@ package net.systemeD.halcyon.connection {
 
         protected var appID:OAuthConsumer;
         protected var authToken:OAuthToken;
-        
-           override public function setAppID(id:Object):void {
-               appID = OAuthConsumer(id);
-           }
-           
+
            override public function setAuthToken(id:Object):void {
                authToken = OAuthToken(id);
            }
@@ -79,7 +75,7 @@ package net.systemeD.halcyon.connection {
             return authToken;
         }
 
-        override public function getConsumer():OAuthConsumer {
+        private function getConsumer():OAuthConsumer {
             if (appID == null) {
               var key:String = getParam("oauth_consumer_key", null);
               var secret:String = getParam("oauth_consumer_secret", null);
@@ -145,7 +141,7 @@ package net.systemeD.halcyon.connection {
         private function signedOAuthURL(url:String, method:String):String {
             // method should be PUT, GET, POST or DELETE
             var sig:IOAuthSignatureMethod = new OAuthSignatureMethod_HMAC_SHA1();
-            var oauthRequest:OAuthRequest = new OAuthRequest(method, url, null, appID, authToken);
+            var oauthRequest:OAuthRequest = new OAuthRequest(method, url, null, getConsumer(), authToken);
             var urlStr:Object = oauthRequest.buildRequest(sig, OAuthRequest.RESULT_TYPE_URL_STRING);
             return String(urlStr);
         }
index 56cff40..7536302 100644 (file)
@@ -25,13 +25,10 @@ package net.systemeD.potlatch2.save {
 
         private function doNothing():void {
             //hack hacky hack hack. Please look the other way...
-            Connection.getConnectionInstance().setAppID(consumer);
         }
 
         private function save(callback:Function):void {
             var conn:Connection = Connection.getConnectionInstance();
-            if ( consumer == null )
-                consumer = conn.getConsumer();
             if ( accessToken == null )
                 accessToken = conn.getAccessToken(SharedObject.getLocal("access_token").data);
         
@@ -66,8 +63,6 @@ package net.systemeD.potlatch2.save {
 
                        if (Connection.getConnectionInstance().getActiveChangeset()) {
                                saveDialog.dontPrompt();
-                       } else {
-                   Connection.getConnectionInstance().setAppID(consumer);
                        }
         }
     }