]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'testing' into 0.9.x
authorEvan Prodromou <evan@status.net>
Fri, 3 Sep 2010 03:41:56 +0000 (23:41 -0400)
committerEvan Prodromou <evan@status.net>
Fri, 3 Sep 2010 03:41:56 +0000 (23:41 -0400)
30 files changed:
js/geometa.js [deleted file]
js/util.js
js/xbImportNode.js [deleted file]
lib/action.php
plugins/OStatus/OStatusPlugin.php
plugins/OStatus/actions/ostatusgroup.php
plugins/OStatus/actions/ostatusinit.php
plugins/OStatus/actions/ostatussub.php
plugins/OStatus/actions/ownerxrd.php
plugins/OStatus/actions/pushcallback.php
plugins/OStatus/actions/pushhub.php
plugins/OStatus/actions/userxrd.php
plugins/OStatus/classes/FeedSub.php
plugins/OStatus/classes/HubSub.php
plugins/OStatus/classes/Magicsig.php
plugins/OStatus/classes/Ostatus_profile.php
plugins/OStatus/lib/discovery.php
plugins/OStatus/lib/hubconfqueuehandler.php
plugins/OStatus/lib/magicenvelope.php
plugins/OStatus/lib/ostatusqueuehandler.php
plugins/OStatus/lib/salmon.php
plugins/OStatus/lib/salmonaction.php
plugins/OStatus/lib/salmonqueuehandler.php
plugins/OStatus/lib/xrd.php
plugins/OStatus/lib/xrdaction.php
plugins/OStatus/scripts/fixup-shadow.php
plugins/OStatus/scripts/testfeed.php
plugins/OStatus/scripts/updateostatus.php
plugins/OStatus/tests/FeedDiscoveryTest.php
plugins/OStatus/tests/remote-tests.php

diff --git a/js/geometa.js b/js/geometa.js
deleted file mode 100644 (file)
index bba59b4..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-// A shim to implement the W3C Geolocation API Specification using Gears or the Ajax API
-if (typeof navigator.geolocation == "undefined" || navigator.geolocation.shim ) { (function(){
-
-// -- BEGIN GEARS_INIT
-(function() {
-  // We are already defined. Hooray!
-  if (window.google && google.gears) {
-    return;
-  }
-
-  var factory = null;
-
-  // Firefox
-  if (typeof GearsFactory != 'undefined') {
-    factory = new GearsFactory();
-  } else {
-    // IE
-    try {
-      factory = new ActiveXObject('Gears.Factory');
-      // privateSetGlobalObject is only required and supported on WinCE.
-      if (factory.getBuildInfo().indexOf('ie_mobile') != -1) {
-        factory.privateSetGlobalObject(this);
-      }
-    } catch (e) {
-      // Safari
-      if ((typeof navigator.mimeTypes != 'undefined') && navigator.mimeTypes["application/x-googlegears"]) {
-        factory = document.createElement("object");
-        factory.style.display = "none";
-        factory.width = 0;
-        factory.height = 0;
-        factory.type = "application/x-googlegears";
-        document.documentElement.appendChild(factory);
-      }
-    }
-  }
-
-  // *Do not* define any objects if Gears is not installed. This mimics the
-  // behavior of Gears defining the objects in the future.
-  if (!factory) {
-    return;
-  }
-
-  // Now set up the objects, being careful not to overwrite anything.
-  //
-  // Note: In Internet Explorer for Windows Mobile, you can't add properties to
-  // the window object. However, global objects are automatically added as
-  // properties of the window object in all browsers.
-  if (!window.google) {
-    google = {};
-  }
-
-  if (!google.gears) {
-    google.gears = {factory: factory};
-  }
-})();
-// -- END GEARS_INIT
-
-var GearsGeoLocation = (function() {
-    // -- PRIVATE
-    var geo = google.gears.factory.create('beta.geolocation');
-    
-    var wrapSuccess = function(callback, self) { // wrap it for lastPosition love
-        return function(position) {
-            callback(position);
-            self.lastPosition = position;
-        };
-    };
-    
-    // -- PUBLIC
-    return {
-        shim: true,
-        
-        type: "Gears",
-        
-        lastPosition: null,
-        
-        getCurrentPosition: function(successCallback, errorCallback, options) {
-            var self = this;
-            var sc = wrapSuccess(successCallback, self);
-            geo.getCurrentPosition(sc, errorCallback, options);
-        },
-        
-        watchPosition: function(successCallback, errorCallback, options) {
-            geo.watchPosition(successCallback, errorCallback, options);
-        },
-        
-        clearWatch: function(watchId) {
-            geo.clearWatch(watchId);
-        },
-        
-        getPermission: function(siteName, imageUrl, extraMessage) {
-            geo.getPermission(siteName, imageUrl, extraMessage);
-        }
-
-    };
-});
-
-var AjaxGeoLocation = (function() {
-    // -- PRIVATE
-    var loading = false;
-    var loadGoogleLoader = function() {
-        if (!hasGoogleLoader() && !loading) {
-            loading = true;
-            var s = document.createElement('script');
-            s.src = (document.location.protocol == "https:"?"https://":"http://") + 'www.google.com/jsapi?callback=_google_loader_apiLoaded';
-            s.type = "text/javascript";
-            document.getElementsByTagName('body')[0].appendChild(s);
-        }
-    };
-    
-    var queue = [];
-    var addLocationQueue = function(callback) {
-        queue.push(callback);
-    };
-    
-    var runLocationQueue = function() {
-        if (hasGoogleLoader()) {
-            while (queue.length > 0) {
-                var call = queue.pop();
-                call();
-            }
-        }
-    };
-    
-    window['_google_loader_apiLoaded'] = function() {
-        runLocationQueue();
-    };
-    
-    var hasGoogleLoader = function() {
-        return (window['google'] && google['loader']);
-    };
-    
-    var checkGoogleLoader = function(callback) {
-        if (hasGoogleLoader()) { return true; }
-
-        addLocationQueue(callback);
-                
-        loadGoogleLoader();
-        
-        return false;
-    };
-    
-    loadGoogleLoader(); // start to load as soon as possible just in case
-    
-    // -- PUBLIC
-    return {
-        shim: true,
-        
-        type: "ClientLocation",
-        
-        lastPosition: null,
-        
-        getCurrentPosition: function(successCallback, errorCallback, options) {
-            var self = this;
-            if (!checkGoogleLoader(function() {
-                self.getCurrentPosition(successCallback, errorCallback, options);
-            })) { return; }
-            
-            if (google.loader.ClientLocation) {
-                var cl = google.loader.ClientLocation;
-                
-                var position = {
-                    coords: {
-                        latitude: cl.latitude,
-                        longitude: cl.longitude,
-                        altitude: null,
-                        accuracy: 43000, // same as Gears accuracy over wifi?
-                        altitudeAccuracy: null,
-                        heading: null,
-                        speed: null
-                    },
-                    // extra info that is outside of the bounds of the core API
-                    address: {
-                        city: cl.address.city,
-                        country: cl.address.country,
-                        country_code: cl.address.country_code,
-                        region: cl.address.region
-                    },
-                    timestamp: new Date()
-                };
-
-                successCallback(position);
-                
-                this.lastPosition = position;
-            } else if (errorCallback === "function")  {
-                errorCallback({ code: 3, message: "Using the Google ClientLocation API and it is not able to calculate a location."});
-            }
-        },
-        
-        watchPosition: function(successCallback, errorCallback, options) {
-            this.getCurrentPosition(successCallback, errorCallback, options);
-            
-            var self = this;
-            var watchId = setInterval(function() {
-                self.getCurrentPosition(successCallback, errorCallback, options);
-            }, 10000);
-            
-            return watchId;
-        },
-        
-        clearWatch: function(watchId) {
-            clearInterval(watchId);
-        },
-        
-        getPermission: function(siteName, imageUrl, extraMessage) {
-            // for now just say yes :)
-            return true;
-        }
-
-    };
-});
-
-// If you have Gears installed use that, else use Ajax ClientLocation
-navigator.geolocation = (window.google && google.gears) ? GearsGeoLocation() : AjaxGeoLocation();
-
-})();
-}
index ad8a44c82ad5d9fa76fe47197bb30796d45a685f..1989e92c099ea050c7edcf3e50e1f22c8297eff1 100644 (file)
@@ -816,3 +816,269 @@ $(document).ready(function(){
     }
 });
 
+// Formerly in xbImportNode.js
+
+/* is this stuff defined? */
+if (!document.ELEMENT_NODE) {
+       document.ELEMENT_NODE = 1;
+       document.ATTRIBUTE_NODE = 2;
+       document.TEXT_NODE = 3;
+       document.CDATA_SECTION_NODE = 4;
+       document.ENTITY_REFERENCE_NODE = 5;
+       document.ENTITY_NODE = 6;
+       document.PROCESSING_INSTRUCTION_NODE = 7;
+       document.COMMENT_NODE = 8;
+       document.DOCUMENT_NODE = 9;
+       document.DOCUMENT_TYPE_NODE = 10;
+       document.DOCUMENT_FRAGMENT_NODE = 11;
+       document.NOTATION_NODE = 12;
+}
+
+document._importNode = function(node, allChildren) {
+       /* find the node type to import */
+       switch (node.nodeType) {
+               case document.ELEMENT_NODE:
+                       /* create a new element */
+                       var newNode = document.createElement(node.nodeName);
+                       /* does the node have any attributes to add? */
+                       if (node.attributes && node.attributes.length > 0)
+                               /* add all of the attributes */
+                               for (var i = 0, il = node.attributes.length; i < il;) {
+                                       if (node.attributes[i].nodeName == 'class') {
+                                               newNode.className = node.getAttribute(node.attributes[i++].nodeName);
+                                       } else {
+                                               newNode.setAttribute(node.attributes[i].nodeName, node.getAttribute(node.attributes[i++].nodeName));
+                                       }
+                               }
+                       /* are we going after children too, and does the node have any? */
+                       if (allChildren && node.childNodes && node.childNodes.length > 0)
+                               /* recursively get all of the child nodes */
+                               for (var i = 0, il = node.childNodes.length; i < il;)
+                                       newNode.appendChild(document._importNode(node.childNodes[i++], allChildren));
+                       return newNode;
+                       break;
+               case document.TEXT_NODE:
+               case document.CDATA_SECTION_NODE:
+               case document.COMMENT_NODE:
+                       return document.createTextNode(node.nodeValue);
+                       break;
+       }
+};
+
+// A shim to implement the W3C Geolocation API Specification using Gears or the Ajax API
+if (typeof navigator.geolocation == "undefined" || navigator.geolocation.shim ) { (function(){
+
+// -- BEGIN GEARS_INIT
+(function() {
+  // We are already defined. Hooray!
+  if (window.google && google.gears) {
+    return;
+  }
+
+  var factory = null;
+
+  // Firefox
+  if (typeof GearsFactory != 'undefined') {
+    factory = new GearsFactory();
+  } else {
+    // IE
+    try {
+      factory = new ActiveXObject('Gears.Factory');
+      // privateSetGlobalObject is only required and supported on WinCE.
+      if (factory.getBuildInfo().indexOf('ie_mobile') != -1) {
+        factory.privateSetGlobalObject(this);
+      }
+    } catch (e) {
+      // Safari
+      if ((typeof navigator.mimeTypes != 'undefined') && navigator.mimeTypes["application/x-googlegears"]) {
+        factory = document.createElement("object");
+        factory.style.display = "none";
+        factory.width = 0;
+        factory.height = 0;
+        factory.type = "application/x-googlegears";
+        document.documentElement.appendChild(factory);
+      }
+    }
+  }
+
+  // *Do not* define any objects if Gears is not installed. This mimics the
+  // behavior of Gears defining the objects in the future.
+  if (!factory) {
+    return;
+  }
+
+  // Now set up the objects, being careful not to overwrite anything.
+  //
+  // Note: In Internet Explorer for Windows Mobile, you can't add properties to
+  // the window object. However, global objects are automatically added as
+  // properties of the window object in all browsers.
+  if (!window.google) {
+    google = {};
+  }
+
+  if (!google.gears) {
+    google.gears = {factory: factory};
+  }
+})();
+// -- END GEARS_INIT
+
+var GearsGeoLocation = (function() {
+    // -- PRIVATE
+    var geo = google.gears.factory.create('beta.geolocation');
+
+    var wrapSuccess = function(callback, self) { // wrap it for lastPosition love
+        return function(position) {
+            callback(position);
+            self.lastPosition = position;
+        };
+    };
+
+    // -- PUBLIC
+    return {
+        shim: true,
+
+        type: "Gears",
+
+        lastPosition: null,
+
+        getCurrentPosition: function(successCallback, errorCallback, options) {
+            var self = this;
+            var sc = wrapSuccess(successCallback, self);
+            geo.getCurrentPosition(sc, errorCallback, options);
+        },
+
+        watchPosition: function(successCallback, errorCallback, options) {
+            geo.watchPosition(successCallback, errorCallback, options);
+        },
+
+        clearWatch: function(watchId) {
+            geo.clearWatch(watchId);
+        },
+
+        getPermission: function(siteName, imageUrl, extraMessage) {
+            geo.getPermission(siteName, imageUrl, extraMessage);
+        }
+
+    };
+});
+
+var AjaxGeoLocation = (function() {
+    // -- PRIVATE
+    var loading = false;
+    var loadGoogleLoader = function() {
+        if (!hasGoogleLoader() && !loading) {
+            loading = true;
+            var s = document.createElement('script');
+            s.src = (document.location.protocol == "https:"?"https://":"http://") + 'www.google.com/jsapi?callback=_google_loader_apiLoaded';
+            s.type = "text/javascript";
+            document.getElementsByTagName('body')[0].appendChild(s);
+        }
+    };
+
+    var queue = [];
+    var addLocationQueue = function(callback) {
+        queue.push(callback);
+    };
+
+    var runLocationQueue = function() {
+        if (hasGoogleLoader()) {
+            while (queue.length > 0) {
+                var call = queue.pop();
+                call();
+            }
+        }
+    };
+
+    window['_google_loader_apiLoaded'] = function() {
+        runLocationQueue();
+    };
+
+    var hasGoogleLoader = function() {
+        return (window['google'] && google['loader']);
+    };
+
+    var checkGoogleLoader = function(callback) {
+        if (hasGoogleLoader()) { return true; }
+
+        addLocationQueue(callback);
+
+        loadGoogleLoader();
+
+        return false;
+    };
+
+    loadGoogleLoader(); // start to load as soon as possible just in case
+
+    // -- PUBLIC
+    return {
+        shim: true,
+
+        type: "ClientLocation",
+
+        lastPosition: null,
+
+        getCurrentPosition: function(successCallback, errorCallback, options) {
+            var self = this;
+            if (!checkGoogleLoader(function() {
+                self.getCurrentPosition(successCallback, errorCallback, options);
+            })) { return; }
+
+            if (google.loader.ClientLocation) {
+                var cl = google.loader.ClientLocation;
+
+                var position = {
+                    coords: {
+                        latitude: cl.latitude,
+                        longitude: cl.longitude,
+                        altitude: null,
+                        accuracy: 43000, // same as Gears accuracy over wifi?
+                        altitudeAccuracy: null,
+                        heading: null,
+                        speed: null
+                    },
+                    // extra info that is outside of the bounds of the core API
+                    address: {
+                        city: cl.address.city,
+                        country: cl.address.country,
+                        country_code: cl.address.country_code,
+                        region: cl.address.region
+                    },
+                    timestamp: new Date()
+                };
+
+                successCallback(position);
+
+                this.lastPosition = position;
+            } else if (errorCallback === "function")  {
+                errorCallback({ code: 3, message: "Using the Google ClientLocation API and it is not able to calculate a location."});
+            }
+        },
+
+        watchPosition: function(successCallback, errorCallback, options) {
+            this.getCurrentPosition(successCallback, errorCallback, options);
+
+            var self = this;
+            var watchId = setInterval(function() {
+                self.getCurrentPosition(successCallback, errorCallback, options);
+            }, 10000);
+
+            return watchId;
+        },
+
+        clearWatch: function(watchId) {
+            clearInterval(watchId);
+        },
+
+        getPermission: function(siteName, imageUrl, extraMessage) {
+            // for now just say yes :)
+            return true;
+        }
+
+    };
+});
+
+// If you have Gears installed use that, else use Ajax ClientLocation
+navigator.geolocation = (window.google && google.gears) ? GearsGeoLocation() : AjaxGeoLocation();
+
+})();
+}
diff --git a/js/xbImportNode.js b/js/xbImportNode.js
deleted file mode 100644 (file)
index f600a47..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/* is this stuff defined? */
-if (!document.ELEMENT_NODE) {
-       document.ELEMENT_NODE = 1;
-       document.ATTRIBUTE_NODE = 2;
-       document.TEXT_NODE = 3;
-       document.CDATA_SECTION_NODE = 4;
-       document.ENTITY_REFERENCE_NODE = 5;
-       document.ENTITY_NODE = 6;
-       document.PROCESSING_INSTRUCTION_NODE = 7;
-       document.COMMENT_NODE = 8;
-       document.DOCUMENT_NODE = 9;
-       document.DOCUMENT_TYPE_NODE = 10;
-       document.DOCUMENT_FRAGMENT_NODE = 11;
-       document.NOTATION_NODE = 12;
-}
-
-document._importNode = function(node, allChildren) {
-       /* find the node type to import */
-       switch (node.nodeType) {
-               case document.ELEMENT_NODE:
-                       /* create a new element */
-                       var newNode = document.createElement(node.nodeName);
-                       /* does the node have any attributes to add? */
-                       if (node.attributes && node.attributes.length > 0)
-                               /* add all of the attributes */
-                               for (var i = 0, il = node.attributes.length; i < il;) {
-                                       if (node.attributes[i].nodeName == 'class') {
-                                               newNode.className = node.getAttribute(node.attributes[i++].nodeName);
-                                       } else {
-                                               newNode.setAttribute(node.attributes[i].nodeName, node.getAttribute(node.attributes[i++].nodeName));
-                                       }
-                               }
-                       /* are we going after children too, and does the node have any? */
-                       if (allChildren && node.childNodes && node.childNodes.length > 0)
-                               /* recursively get all of the child nodes */
-                               for (var i = 0, il = node.childNodes.length; i < il;)
-                                       newNode.appendChild(document._importNode(node.childNodes[i++], allChildren));
-                       return newNode;
-                       break;
-               case document.TEXT_NODE:
-               case document.CDATA_SECTION_NODE:
-               case document.COMMENT_NODE:
-                       return document.createTextNode(node.nodeValue);
-                       break;
-       }
-};
-
index c86dd2d869003a4bf9e41d27557c44f9d1bdcf52..a2638993f7873964a7ff16ac179bc7c7b98dafaf 100644 (file)
@@ -281,9 +281,7 @@ class Action extends HTMLOutputter // lawsuit
             }
             if (Event::handle('StartShowStatusNetScripts', array($this)) &&
                 Event::handle('StartShowLaconicaScripts', array($this))) {
-                $this->script('xbImportNode.js');
                 $this->script('util.js');
-                $this->script('geometa.js');
                 // Frame-busting code to avoid clickjacking attacks.
                 $this->inlineScript('if (window.top !== window.self) { window.top.location.href = window.self.location.href; }');
                 Event::handle('EndShowStatusNetScripts', array($this));
@@ -996,31 +994,59 @@ class Action extends HTMLOutputter // lawsuit
     function handle($argarray=null)
     {
         header('Vary: Accept-Encoding,Cookie');
+
         $lm   = $this->lastModified();
         $etag = $this->etag();
+
         if ($etag) {
             header('ETag: ' . $etag);
         }
+
         if ($lm) {
             header('Last-Modified: ' . date(DATE_RFC1123, $lm));
-            if (array_key_exists('HTTP_IF_MODIFIED_SINCE', $_SERVER)) {
-                $if_modified_since = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
-                $ims = strtotime($if_modified_since);
-                if ($lm <= $ims) {
-                    $if_none_match = (array_key_exists('HTTP_IF_NONE_MATCH', $_SERVER)) ?
-                      $_SERVER['HTTP_IF_NONE_MATCH'] : null;
-                    if (!$if_none_match ||
-                        !$etag ||
-                        $this->_hasEtag($etag, $if_none_match)) {
-                        header('HTTP/1.1 304 Not Modified');
-                        // Better way to do this?
-                        exit(0);
-                    }
-                }
+            if ($this->isCacheable()) {
+                header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' );
+                header( "Cache-Control: private, must-revalidate, max-age=0" );
+                header( "Pragma: underwear-catapult");
+            }
+        }
+
+        if ($etag) {
+            $if_none_match = (array_key_exists('HTTP_IF_NONE_MATCH', $_SERVER)) ?
+              $_SERVER['HTTP_IF_NONE_MATCH'] : null;
+            if ($if_none_match && $this->_hasEtag($etag, $if_none_match)) {
+                header('HTTP/1.1 304 Not Modified');
+                // Better way to do this?
+                exit(0);
+            }
+        }
+
+        if ($lm && array_key_exists('HTTP_IF_MODIFIED_SINCE', $_SERVER)) {
+            $if_modified_since = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
+            $ims = strtotime($if_modified_since);
+            if ($lm <= $ims) {
+                header('HTTP/1.1 304 Not Modified');
+                // Better way to do this?
+                exit(0);
             }
         }
     }
 
+    /**
+     * Is this action cacheable?
+     *
+     * If the action returns a last-modified
+     *
+     * @param array $argarray is ignored since it's now passed in in prepare()
+     *
+     * @return boolean is read only action?
+     */
+
+    function isCacheable()
+    {
+        return true;
+    }
+
     /**
      * Has etag? (private)
      *
index f9a8782faa119284f8414d508e8a637185b92c31..77bc9872b401827057bc6b5c92fc118ead2b4fb1 100644 (file)
@@ -564,7 +564,9 @@ class OStatusPlugin extends Plugin
 
         $act->time    = time();
         $act->title   = _("Follow");
-        $act->content = sprintf(_("%s is now following %s."),
+        // TRANS: Success message for subscribe to user attempt through OStatus.
+        // TRANS: %1$s is the subscriber name, %2$s is the subscribed user's name.
+        $act->content = sprintf(_("%1$s is now following %2$s."),
                                $subscriber->getBestName(),
                                $other->getBestName());
 
@@ -612,7 +614,9 @@ class OStatusPlugin extends Plugin
 
         $act->time    = time();
         $act->title   = _("Unfollow");
-        $act->content = sprintf(_("%s stopped following %s."),
+        // TRANS: Success message for unsubscribe from user attempt through OStatus.
+        // TRANS: %1$s is the unsubscriber's name, %2$s is the unsubscribed user's name.
+        $act->content = sprintf(_("%1$s stopped following %2$s."),
                                $profile->getBestName(),
                                $other->getBestName());
 
@@ -657,7 +661,9 @@ class OStatusPlugin extends Plugin
 
             $act->time = time();
             $act->title = _m("Join");
-            $act->content = sprintf(_m("%s has joined group %s."),
+            // TRANS: Success message for subscribe to group attempt through OStatus.
+            // TRANS: %1$s is the member name, %2$s is the subscribed group's name.
+            $act->content = sprintf(_m("%1$s has joined group %2$s."),
                                     $member->getBestName(),
                                     $oprofile->getBestName());
 
@@ -706,7 +712,9 @@ class OStatusPlugin extends Plugin
 
             $act->time = time();
             $act->title = _m("Leave");
-            $act->content = sprintf(_m("%s has left group %s."),
+            // TRANS: Success message for unsubscribe from group attempt through OStatus.
+            // TRANS: %1$s is the member name, %2$s is the unsubscribed group's name.
+            $act->content = sprintf(_m("%1$s has left group %2$s."),
                                     $member->getBestName(),
                                     $oprofile->getBestName());
 
@@ -746,7 +754,9 @@ class OStatusPlugin extends Plugin
 
         $act->time    = time();
         $act->title   = _("Favor");
-        $act->content = sprintf(_("%s marked notice %s as a favorite."),
+        // TRANS: Success message for adding a favorite notice through OStatus.
+        // TRANS: %1$s is the favoring user's name, %2$s is URI to the favored notice.
+        $act->content = sprintf(_("%1$s marked notice %2$s as a favorite."),
                                $profile->getBestName(),
                                $notice->uri);
 
@@ -790,7 +800,9 @@ class OStatusPlugin extends Plugin
                                   common_date_iso8601(time()));
         $act->time    = time();
         $act->title   = _("Disfavor");
-        $act->content = sprintf(_("%s marked notice %s as no longer a favorite."),
+        // TRANS: Success message for remove a favorite notice through OStatus.
+        // TRANS: %1$s is the unfavoring user's name, %2$s is URI to the no longer favored notice.
+        $act->content = sprintf(_("%1$s marked notice %2$s as no longer a favorite."),
                                $profile->getBestName(),
                                $notice->uri);
 
@@ -865,7 +877,7 @@ class OStatusPlugin extends Plugin
                                              'class' => 'entity_subscribe'));
             $action->element('a', array('href' => common_local_url($target),
                                         'class' => 'entity_remote_subscribe')
-                                , _m('Remote'));
+                                , _m('Remote')); // @todo: i18n: Add translator hint for this text.
             $action->elementEnd('p');
             $action->elementEnd('div');
         }
@@ -905,6 +917,8 @@ class OStatusPlugin extends Plugin
                                   common_date_iso8601(time()));
         $act->time    = time();
         $act->title   = _m("Profile update");
+        // TRANS: Ping text for remote profile update through OStatus.
+        // TRANS: %s is user that updated their profile.
         $act->content = sprintf(_m("%s has updated their profile page."),
                                $profile->getBestName());
 
@@ -934,7 +948,7 @@ class OStatusPlugin extends Plugin
                                         array('nickname' => $profileUser->nickname));
                 $output->element('a', array('href' => $url,
                                             'class' => 'entity_remote_subscribe'),
-                                 _m('Subscribe'));
+                                 _m('Subscribe')); // @todo: i18n: Add context.
                 $output->elementEnd('li');
             }
         }
@@ -950,7 +964,7 @@ class OStatusPlugin extends Plugin
                             'homepage' => 'http://status.net/wiki/Plugin:OStatus',
                             'rawdescription' =>
                             _m('Follow people across social networks that implement '.
-                               '<a href="http://ostatus.org/">OStatus</a>.'));
+                               '<a href="http://ostatus.org/">OStatus</a>.')); // @todo i18n: Add translator hint.
 
         return true;
     }
index 1b368de63cd64c37a02d1c8d4d5e35ec47694af2..1861e866f293a51b30851375c1e81373c8b3b8b6 100644 (file)
@@ -74,7 +74,7 @@ class OStatusGroupAction extends OStatusSubAction
         $this->input('profile',
                      _m('Join group'),
                      $this->profile_uri,
-                     _m("OStatus group's address, like http://example.net/group/nickname"));
+                     _m("OStatus group's address, like http://example.net/group/nickname."));
         $this->elementEnd('li');
         $this->elementEnd('ul');
 
index 22aea9f7097831faf5aafee5944b800d1ef56cac..0c991aba98659602470fe1a51dd6100ce2ab0ada 100644 (file)
@@ -45,13 +45,13 @@ class OStatusInitAction extends Action
         // Local user or group the remote wants to subscribe to
         $this->nickname = $this->trimmed('nickname');
         $this->group = $this->trimmed('group');
-        
+
         // Webfinger or profile URL of the remote user
         $this->profile = $this->trimmed('profile');
 
         return true;
     }
-    
+
     function handle($args)
     {
         parent::handle($args);
@@ -69,7 +69,7 @@ class OStatusInitAction extends Action
             $this->showForm();
         }
     }
-    
+
     function showForm($err = null)
     {
         $this->err = $err;
@@ -109,12 +109,12 @@ class OStatusInitAction extends Action
         $this->elementStart('ul', 'form_data');
         $this->elementStart('li', array('id' => 'ostatus_nickname'));
         $this->input('nickname', _m('User nickname'), $this->nickname,
-                     _m('Nickname of the user you want to follow'));
+                     _m('Nickname of the user you want to follow.'));
         $this->hidden('group', $this->group); // pass-through for magic links
         $this->elementEnd('li');
         $this->elementStart('li', array('id' => 'ostatus_profile'));
         $this->input('profile', _m('Profile Account'), $this->profile,
-                     _m('Your account id (i.e. user@identi.ca)'));
+                     _m('Your account id (e.g. user@identi.ca).'));
         $this->elementEnd('li');
         $this->elementEnd('ul');
         $this->submit('submit', $submit);
@@ -199,7 +199,7 @@ class OStatusInitAction extends Action
 
     function title()
     {
-      return _m('OStatus Connect');  
+      return _m('OStatus Connect');
     }
-  
+
 }
index 28714514f5ec402827bfd9cbe4df06fee5e26cc6..4cbd7d034877157aaa9d6aedf4ec2ba38f918745 100644 (file)
@@ -64,11 +64,11 @@ class OStatusSubAction extends Action
         $this->input('profile',
                      _m('Subscribe to'),
                      $this->profile_uri,
-                     _m("OStatus user's address, like nickname@example.com or http://example.net/nickname"));
+                     _m("OStatus user's address, like nickname@example.com or http://example.net/nickname"));  // @todo i18n FIXME: needs context/translator hint.
         $this->elementEnd('li');
         $this->elementEnd('ul');
 
-        $this->submit('validate', _m('Continue'));
+        $this->submit('validate', _m('Continue')); // @todo i18n FIXME: needs context/translator hint.
 
         $this->elementEnd('fieldset');
 
@@ -103,10 +103,10 @@ class OStatusSubAction extends Action
         $this->hidden('profile', $this->profile_uri);
         if ($this->oprofile->isGroup()) {
             $this->submit('submit', _m('Join'), 'submit', null,
-                         _m('Join this group'));
+                         _m('Join this group')); // @todo i18n FIXME: needs context/translator hint.
         } else {
             $this->submit('submit', _m('Confirm'), 'submit', null,
-                         _m('Subscribe to this user'));
+                         _m('Subscribe to this user')); // @todo i18n FIXME: needs context/translator hint.
         }
         $this->elementEnd('fieldset');
         $this->elementEnd('form');
@@ -244,13 +244,13 @@ class OStatusSubAction extends Action
             } else if (Validate::uri($this->profile_uri)) {
                 $this->oprofile = Ostatus_profile::ensureProfileURL($this->profile_uri);
             } else {
-                $this->error = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname");
+                $this->error = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname.");
                 common_debug('Invalid address format.', __FILE__);
                 return false;
             }
             return true;
         } catch (FeedSubBadURLException $e) {
-            $this->error = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname");
+            $this->error = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname.");
             common_debug('Invalid URL or could not reach server.', __FILE__);
         } catch (FeedSubBadResponseException $e) {
             $this->error = _m("Sorry, we could not reach that feed. Please try that OStatus address again later.");
@@ -269,7 +269,7 @@ class OStatusSubAction extends Action
             common_debug('Not a recognized feed type.', __FILE__);
         } catch (Exception $e) {
             // Any new ones we forgot about
-            $this->error = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname");
+            $this->error = _m("Sorry, we could not reach that address. Please make sure that the OStatus address is like nickname@example.com or http://example.net/nickname.");
             common_debug(sprintf('Bad feed URL: %s %s', get_class($e), $e->getMessage()), __FILE__);
         }
 
index 9c141d8c79692fce4947f5288ba06057dd7d1c2b..3fcb982b879f614e28d99a9b97657b2d86ac9a66 100644 (file)
@@ -32,7 +32,7 @@ class OwnerxrdAction extends XrdAction
     function prepare($args)
     {
         $this->user = User::siteOwner();
-        
+
         if (!$this->user) {
             $this->clientError(_('No such user.'), 404);
             return false;
@@ -40,7 +40,7 @@ class OwnerxrdAction extends XrdAction
 
         $nick = common_canonical_nickname($this->user->nickname);
         $acct = 'acct:' . $nick . '@' . common_config('site', 'server');
-        
+
         $this->xrd = new XRD();
 
         // Check to see if a $config['webfinger']['owner'] has been set
index 9a2067b8ca0725e5b8ffa201add9bc4fedf4ba03..6c69787455df7dde3c2e88aa2aed66066eee7048 100644 (file)
@@ -37,7 +37,7 @@ class PushCallbackAction extends Action
             $this->handleGet();
         }
     }
-    
+
     /**
      * Handler for POST content updates from the hub
      */
@@ -46,11 +46,12 @@ class PushCallbackAction extends Action
         $feedid = $this->arg('feed');
         common_log(LOG_INFO, "POST for feed id $feedid");
         if (!$feedid) {
-            throw new ServerException('Empty or invalid feed id', 400);
+            throw new ServerException('Empty or invalid feed id.', 400);
         }
 
         $feedsub = FeedSub::staticGet('id', $feedid);
         if (!$feedsub) {
+            // @todo i18n FIXME: added i18n and use sprintf when using parameters.
             throw new ServerException('Unknown PuSH feed id ' . $feedid, 400);
         }
 
@@ -70,7 +71,7 @@ class PushCallbackAction extends Action
         $qm = QueueManager::get();
         $qm->enqueue($data, 'pushin');
     }
-    
+
     /**
      * Handler for GET verification requests from the hub.
      */
@@ -88,20 +89,24 @@ class PushCallbackAction extends Action
 
         $feedsub = FeedSub::staticGet('uri', $topic);
         if (!$feedsub) {
-            throw new ClientException("Bad hub.topic feed $topic", 404);
+            // @todo i18n FIXME: added i18n and use sprintf when using parameters.
+            throw new ClientException("Bad hub.topic feed $topic.", 404);
         }
 
         if ($feedsub->verify_token !== $verify_token) {
-            throw new ClientException("Bad hub.verify_token $token for $topic", 404);
+            // @todo i18n FIXME: added i18n and use sprintf when using parameters.
+            throw new ClientException("Bad hub.verify_token $token for $topic.", 404);
         }
 
         if ($mode == 'subscribe') {
             // We may get re-sub requests legitimately.
             if ($feedsub->sub_state != 'subscribe' && $feedsub->sub_state != 'active') {
+                // @todo i18n FIXME: added i18n and use sprintf when using parameters.
                 throw new ClientException("Unexpected subscribe request for $topic.", 404);
             }
         } else {
             if ($feedsub->sub_state != 'unsubscribe') {
+                // @todo i18n FIXME: added i18n and use sprintf when using parameters.
                 throw new ClientException("Unexpected unsubscribe request for $topic.", 404);
             }
         }
index 842d65e7d29d9eac29518249560aa98c3e37a7e7..6909b8539131f4c57dc38425561398147350a045 100644 (file)
@@ -36,7 +36,6 @@ Things to consider...
 
 */
 
-
 class PushHubAction extends Action
 {
     function arg($arg, $def=null)
@@ -63,8 +62,10 @@ class PushHubAction extends Action
             $this->subunsub($mode);
             break;
         case "publish":
+            // @todo i18n FIXME: added i18n and use sprintf when using parameters.
             throw new ClientException("Publishing outside feeds not supported.", 400);
         default:
+            // @todo i18n FIXME: added i18n and use sprintf when using parameters.
             throw new ClientException("Unrecognized mode '$mode'.", 400);
         }
     }
@@ -84,16 +85,19 @@ class PushHubAction extends Action
 
         $topic = $this->argUrl('hub.topic');
         if (!$this->recognizedFeed($topic)) {
+            // @todo i18n FIXME: added i18n and use sprintf when using parameters.
             throw new ClientException("Unsupported hub.topic $topic; this hub only serves local user and group Atom feeds.");
         }
 
         $verify = $this->arg('hub.verify'); // @fixme may be multiple
         if ($verify != 'sync' && $verify != 'async') {
+            // @todo i18n FIXME: added i18n and use sprintf when using parameters.
             throw new ClientException("Invalid hub.verify $verify; must be sync or async.");
         }
 
         $lease = $this->arg('hub.lease_seconds', null);
         if ($mode == 'subscribe' && $lease != '' && !preg_match('/^\d+$/', $lease)) {
+            // @todo i18n FIXME: added i18n and use sprintf when using parameters.
             throw new ClientException("Invalid hub.lease $lease; must be empty or positive integer.");
         }
 
@@ -101,6 +105,7 @@ class PushHubAction extends Action
 
         $secret = $this->arg('hub.secret', null);
         if ($secret != '' && strlen($secret) >= 200) {
+            // @todo i18n FIXME: added i18n and use sprintf when using parameters.
             throw new ClientException("Invalid hub.secret $secret; must be under 200 bytes.");
         }
 
@@ -152,6 +157,7 @@ class PushHubAction extends Action
             if ($feed == $userFeed) {
                 $user = User::staticGet('id', $id);
                 if (!$user) {
+                    // @todo i18n FIXME: added i18n and use sprintf when using parameters.
                     throw new ClientException("Invalid hub.topic $feed; user doesn't exist.");
                 } else {
                     return true;
@@ -160,6 +166,7 @@ class PushHubAction extends Action
             if ($feed == $groupFeed) {
                 $user = User_group::staticGet('id', $id);
                 if (!$user) {
+                    // @todo i18n FIXME: added i18n and use sprintf when using parameters.
                     throw new ClientException("Invalid hub.topic $feed; group doesn't exist.");
                 } else {
                     return true;
@@ -183,6 +190,7 @@ class PushHubAction extends Action
         if (Validate::uri($url, $params)) {
             return $url;
         } else {
+            // @todo i18n FIXME: added i18n and use sprintf when using parameters.
             throw new ClientException("Invalid URL passed for $arg: '$url'");
         }
     }
@@ -199,4 +207,3 @@ class PushHubAction extends Action
         return HubSub::staticGet($feed, $callback);
     }
 }
-
index 6a6886eb8c78c06c5126680f68be94df26ac3472..dd720568b49ae318211e5ba5210c17511ee80522 100644 (file)
@@ -33,7 +33,7 @@ class UserxrdAction extends XrdAction
 
         $this->uri = $this->trimmed('uri');
         $this->uri = Discovery::normalize($this->uri);
-        
+
         if (Discovery::isWebfinger($this->uri)) {
             $parts = explode('@', substr(urldecode($this->uri), 5));
             if (count($parts) == 2) {
index dd1968db12a52c3173d84f38f7e8c343a173a8ef..6f9e0856ab1aeb821b8927e43dbd412710c4eb33 100644 (file)
@@ -249,7 +249,7 @@ class FeedSub extends Memcached_DataObject
                 // We'll never actually get updates in this mode.
                 return true;
             } else {
-                throw new ServerException("Attempting to start PuSH subscription for feed with no hub");
+                throw new ServerException("Attempting to start PuSH subscription for feed with no hub.");
             }
         }
 
@@ -279,7 +279,7 @@ class FeedSub extends Memcached_DataObject
                 // We'll never actually get updates in this mode.
                 return true;
             } else {
-                throw new ServerException("Attempting to end PuSH subscription for feed with no hub");
+                throw new ServerException("Attempting to end PuSH subscription for feed with no hub.");
             }
         }
 
@@ -502,4 +502,3 @@ class FeedSub extends Memcached_DataObject
     }
 
 }
-
index 7db528a4e85772a23ad35823cb5592e0edde6951..e01ae4e798d8190f1461f3db2081fa89ec7b3db7 100644 (file)
@@ -206,6 +206,7 @@ class HubSub extends Memcached_DataObject
         if ($status >= 200 && $status < 300) {
             common_log(LOG_INFO, "Verified $mode of $this->callback:$this->topic");
         } else {
+            // @todo i18n FIXME: add i18n and use sprintf for parameter.
             throw new ClientException("Hub subscriber verification returned HTTP $status");
         }
 
@@ -307,9 +308,9 @@ class HubSub extends Memcached_DataObject
     /**
      * Queue up a large batch of pushes to multiple subscribers
      * for this same topic update.
-     * 
+     *
      * If queues are disabled, this will run immediately.
-     * 
+     *
      * @param string $atom well-formed Atom feed
      * @param array $pushCallbacks list of callback URLs
      */
@@ -359,4 +360,3 @@ class HubSub extends Memcached_DataObject
         }
     }
 }
-
index f8c56a05f3b9bd4a463b27da621f9addb9272556..e39a6d8f7ce01280c66a2f470ac1154e6734116f 100644 (file)
@@ -33,21 +33,21 @@ class Magicsig extends Memcached_DataObject
 {
 
     const PUBLICKEYREL = 'magic-public-key';
-    
+
     public $__table = 'magicsig';
 
     public $user_id;
     public $keypair;
     public $alg;
-    
+
     public $publicKey;
     public $privateKey;
-    
+
     public function __construct($alg = 'RSA-SHA256')
     {
         $this->alg = $alg;
     }
-    
+
     public /*static*/ function staticGet($k, $v=null)
     {
         $obj =  parent::staticGet(__CLASS__, $k, $v);
@@ -111,7 +111,7 @@ class Magicsig extends Memcached_DataObject
     public function generate($user_id)
     {
         $rsa = new Crypt_RSA();
-        
+
         $keypair = $rsa->createKey();
 
         $rsa->loadKey($keypair['privatekey']);
@@ -121,7 +121,7 @@ class Magicsig extends Memcached_DataObject
 
         $this->publicKey = new Crypt_RSA();
         $this->publicKey->loadKey($keypair['publickey']);
-        
+
         $this->user_id = $user_id;
         $this->insert();
     }
@@ -136,13 +136,13 @@ class Magicsig extends Memcached_DataObject
             $private_exp = '.' . Magicsig::base64_url_encode($this->privateKey->exponent->toBytes());
         }
 
-        return 'RSA.' . $mod . '.' . $exp . $private_exp; 
+        return 'RSA.' . $mod . '.' . $exp . $private_exp;
     }
-    
+
     public static function fromString($text)
     {
         $magic_sig = new Magicsig();
-        
+
         // remove whitespace
         $text = preg_replace('/\s+/', '', $text);
 
@@ -150,7 +150,7 @@ class Magicsig extends Memcached_DataObject
         if (!preg_match('/RSA\.([^\.]+)\.([^\.]+)(.([^\.]+))?/', $text, $matches)) {
             return false;
         }
-        
+
         $mod = $matches[1];
         $exp = $matches[2];
         if (!empty($matches[4])) {
@@ -184,7 +184,7 @@ class Magicsig extends Memcached_DataObject
             $this->publicKey = $rsa;
         }
     }
-    
+
     public function getName()
     {
         return $this->alg;
@@ -199,7 +199,7 @@ class Magicsig extends Memcached_DataObject
         }
 
     }
-    
+
     public function sign($bytes)
     {
         $sig = $this->privateKey->sign($bytes);
@@ -223,5 +223,3 @@ class Magicsig extends Memcached_DataObject
         return base64_decode(strtr($input, '-_', '+/'));
     }
 }
-
-
index 898c63e83e438fe08970a1bf8e8dc6e14fb9bbef..6a0fd1f3bd4de2d1ee6b8e5f048022377dd584f7 100644 (file)
@@ -188,9 +188,11 @@ class Ostatus_profile extends Memcached_DataObject
         } else if ($this->group_id && !$this->profile_id) {
             return true;
         } else if ($this->group_id && $this->profile_id) {
-            throw new ServerException("Invalid ostatus_profile state: both group and profile IDs set for $this->uri");
+            // @todo i18n FIXME: use sprintf and add i18n.
+            throw new ServerException("Invalid ostatus_profile state: both group and profile IDs set for $this->uri.");
         } else {
-            throw new ServerException("Invalid ostatus_profile state: both group and profile IDs empty for $this->uri");
+            // @todo i18n FIXME: use sprintf and add i18n.
+            throw new ServerException("Invalid ostatus_profile state: both group and profile IDs empty for $this->uri.");
         }
     }
 
@@ -370,7 +372,8 @@ class Ostatus_profile extends Memcached_DataObject
         } else if ($entry instanceof Notice) {
             return $preamble . $entry->asAtomEntry(true, true);
         } else {
-            throw new ServerException("Invalid type passed to Ostatus_profile::notify; must be XML string or Activity entry");
+            // @todo i18n FIXME: use sprintf and add i18n.
+            throw new ServerException("Invalid type passed to Ostatus_profile::notify; must be XML string or Activity entry.");
         }
     }
 
@@ -549,7 +552,8 @@ class Ostatus_profile extends Memcached_DataObject
             $sourceContent = $note->title;
         } else {
             // @fixme fetch from $sourceUrl?
-            throw new ClientException("No content for notice {$sourceUri}");
+            // @todo i18n FIXME: use sprintf and add i18n.
+            throw new ClientException("No content for notice {$sourceUri}.");
         }
 
         // Get (safe!) HTML and text versions of the content
@@ -587,7 +591,7 @@ class Ostatus_profile extends Memcached_DataObject
                             ' class="attachment more"' .
                             ' title="'. htmlspecialchars(_m('Show more')) . '">' .
                             '&#8230;' .
-                            '</a>';
+                            '</a>'; // @todo i18n FIXME: add translator hint/context.
             }
         }
 
@@ -772,6 +776,7 @@ class Ostatus_profile extends Memcached_DataObject
         $response = $client->get($profile_url);
 
         if (!$response->isOk()) {
+            // @todo i18n FIXME: use sprintf and add i18n.
             throw new Exception("Could not reach profile page: " . $profile_url);
         }
 
@@ -829,6 +834,7 @@ class Ostatus_profile extends Memcached_DataObject
             return self::ensureFeedURL($feedurl, $hints);
         }
 
+        // @todo i18n FIXME: use sprintf and add i18n.
         throw new Exception("Could not find a feed URL for profile page " . $finalUrl);
     }
 
@@ -861,6 +867,7 @@ class Ostatus_profile extends Memcached_DataObject
         $user = User::staticGet('id', $profile->id);
 
         if (!empty($user)) {
+            // @todo i18n FIXME: use sprintf and add i18n.
             throw new OStatusShadowException($profile, "'$profile_url' is the profile for local user '{$user->nickname}'.");
         }
 
@@ -1025,7 +1032,7 @@ class Ostatus_profile extends Memcached_DataObject
             return;
         }
         if (!common_valid_http_url($url)) {
-            throw new ServerException(sprintf(_m("Invalid avatar URL %s"), $url));
+            throw new ServerException(sprintf(_m("Invalid avatar URL %s."), $url));
         }
 
         if ($this->isGroup()) {
@@ -1035,7 +1042,7 @@ class Ostatus_profile extends Memcached_DataObject
         }
         if (!$self) {
             throw new ServerException(sprintf(
-                _m("Tried to update avatar for unsaved remote profile %s"),
+                _m("Tried to update avatar for unsaved remote profile %s."),
                 $this->uri));
         }
 
@@ -1043,7 +1050,7 @@ class Ostatus_profile extends Memcached_DataObject
         // ripped from oauthstore.php (for old OMB client)
         $temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar');
         if (!copy($url, $temp_filename)) {
-            throw new ServerException(sprintf(_m("Unable to fetch avatar from %s"), $url));
+            throw new ServerException(sprintf(_m("Unable to fetch avatar from %s."), $url));
         }
 
         if ($this->isGroup()) {
@@ -1226,7 +1233,7 @@ class Ostatus_profile extends Memcached_DataObject
         if ($object->link && common_valid_http_url($object->link)) {
             return $object->link;
         }
-        throw new ServerException("No author ID URI found");
+        throw new ServerException("No author ID URI found.");
     }
 
     /**
@@ -1256,10 +1263,12 @@ class Ostatus_profile extends Memcached_DataObject
 
         $user = User::staticGet('uri', $homeuri);
         if ($user) {
+            // @todo i18n FIXME: add i18n.
             throw new Exception("Local user can't be referenced as remote.");
         }
 
         if (OStatusPlugin::localGroupFromUrl($homeuri)) {
+            // @todo i18n FIXME: add i18n.
             throw new Exception("Local group can't be referenced as remote.");
         }
 
@@ -1311,7 +1320,8 @@ class Ostatus_profile extends Memcached_DataObject
 
             $oprofile->profile_id = $profile->insert();
             if (!$oprofile->profile_id) {
-                throw new ServerException("Can't save local profile");
+                // @todo i18n FIXME: add i18n.
+                throw new ServerException("Can't save local profile.");
             }
         } else {
             $group = new User_group();
@@ -1321,14 +1331,16 @@ class Ostatus_profile extends Memcached_DataObject
 
             $oprofile->group_id = $group->insert();
             if (!$oprofile->group_id) {
-                throw new ServerException("Can't save local profile");
+                // @todo i18n FIXME: add i18n.
+                throw new ServerException("Can't save local profile.");
             }
         }
 
         $ok = $oprofile->insert();
 
         if (!$ok) {
-            throw new ServerException("Can't save OStatus profile");
+            // @todo i18n FIXME: add i18n.
+            throw new ServerException("Can't save OStatus profile.");
         }
 
         $avatar = self::getActivityObjectAvatar($object, $hints);
@@ -1586,6 +1598,7 @@ class Ostatus_profile extends Memcached_DataObject
         if ($uri !== false) {
             if (is_null($uri)) {
                 // Negative cache entry
+                // @todo i18n FIXME: add i18n.
                 throw new Exception('Not a valid webfinger address.');
             }
             $oprofile = Ostatus_profile::staticGet('uri', $uri);
@@ -1613,6 +1626,7 @@ class Ostatus_profile extends Memcached_DataObject
             // Save negative cache entry so we don't waste time looking it up again.
             // @fixme distinguish temporary failures?
             self::cacheSet(sprintf('ostatus_profile:webfinger:%s', $addr), null);
+            // @todo i18n FIXME: add i18n.
             throw new Exception('Not a valid webfinger address.');
         }
 
@@ -1694,7 +1708,8 @@ class Ostatus_profile extends Memcached_DataObject
 
             if (!$profile_id) {
                 common_log_db_error($profile, 'INSERT', __FILE__);
-                throw new Exception("Couldn't save profile for '$addr'");
+                // @todo i18n FIXME: add i18n and use sprintf for parameter.
+                throw new Exception("Couldn't save profile for '$addr'.");
             }
 
             $oprofile = new Ostatus_profile();
@@ -1712,13 +1727,15 @@ class Ostatus_profile extends Memcached_DataObject
 
             if (!$result) {
                 common_log_db_error($oprofile, 'INSERT', __FILE__);
-                throw new Exception("Couldn't save ostatus_profile for '$addr'");
+                // @todo i18n FIXME: add i18n and use sprintf for parameter.
+                throw new Exception("Couldn't save ostatus_profile for '$addr'.");
             }
 
             self::cacheSet(sprintf('ostatus_profile:webfinger:%s', $addr), $oprofile->uri);
             return $oprofile;
         }
 
+        // @todo i18n FIXME: add i18n and use sprintf for parameter.
         throw new Exception("Couldn't find a valid profile for '$addr'");
     }
 
@@ -1818,4 +1835,3 @@ class OStatusShadowException extends Exception
         parent::__construct($message);
     }
 }
-
index 7187c1f3e95ca122f704d52b4d92f6712e23dead..ed22b452f108734151cd00ea3f3330810442f564 100644 (file)
@@ -106,7 +106,8 @@ class Discovery
             }
         }
 
-        throw new Exception('Unable to find services for '. $id);
+        // @todo Needs i18n.
+        throw new Exception('Unable to find services for '. $id '.');
     }
 
     public static function getService($links, $service) {
@@ -160,7 +161,7 @@ class Discovery_LRDD_Host_Meta implements Discovery_LRDD
         } else {
             $domain = parse_url($uri, PHP_URL_HOST);
         }
-        
+
         $url = 'http://'. $domain .'/.well-known/host-meta';
 
         $xrd = Discovery::fetchXrd($url);
index c8e0b72fee9c4d7a4c1e2eba97552488bd820f3c..8219f8420e79b4cec4c44766da2829a9087384c7 100644 (file)
@@ -51,4 +51,3 @@ class HubConfQueueHandler extends QueueHandler
         return true;
     }
 }
-
index 967e5f6d17683fe235930f06207be095e91de711..bbd4ce17a24f69e172f1fa5c14ffaa21d9a6d819 100644 (file)
@@ -32,7 +32,7 @@ class MagicEnvelope
     const ENCODING = 'base64url';
 
     const NS = 'http://salmon-protocol.org/ns/magic-env';
-    
+
     private function normalizeUser($user_id)
     {
         if (substr($user_id, 0, 5) == 'http:' ||
@@ -70,13 +70,13 @@ class MagicEnvelope
                         $keypair = $parts[1];
                     }
                 }
-                
+
                 if ($keypair) {
                     return $keypair;
                 }
             }
         }
-        throw new Exception('Unable to locate signer public key');
+        throw new Exception('Unable to locate signer public key.');
     }
 
 
@@ -92,8 +92,7 @@ class MagicEnvelope
             'sig' => $signature_alg->sign($armored_text),
             'alg' => $signature_alg->getName()
         );
-            
-            
+
     }
 
     public function toXML($env) {
@@ -105,13 +104,13 @@ class MagicEnvelope
         $xs->element('me:alg', null, $env['alg']);
         $xs->element('me:sig', null, $env['sig']);
         $xs->elementEnd('me:env');
-        
+
         $string =  $xs->getString();
         common_debug($string);
         return $string;
     }
 
-    
+
     public function unfold($env)
     {
         $dom = new DOMDocument();
@@ -137,7 +136,7 @@ class MagicEnvelope
 
         return $dom->saveXML();
     }
-    
+
     public function getAuthor($text) {
         $doc = new DOMDocument();
         if (!$doc->loadXML($text)) {
@@ -154,12 +153,12 @@ class MagicEnvelope
             }
         }
     }
-    
+
     public function checkAuthor($text, $signer_uri)
     {
         return ($this->getAuthor($text) == $signer_uri);
     }
-    
+
     public function verify($env)
     {
         if ($env['alg'] != 'RSA-SHA256') {
@@ -181,14 +180,14 @@ class MagicEnvelope
             common_log(LOG_DEBUG, "Salmon error: ".$e->getMessage());
             return false;
         }
-        
+
         $verifier = Magicsig::fromString($keypair);
 
         if (!$verifier) {
             common_log(LOG_DEBUG, "Salmon error: unable to parse keypair");
             return false;
         }
-        
+
         return $verifier->verify($env['data'], $env['sig']);
     }
 
index 5e318116a6e1a3d479d5ffd379cb655a71009be7..9814cab9f18d99fe4ff34e4811a82c22fa1baae0 100644 (file)
@@ -223,4 +223,3 @@ class OStatusQueueHandler extends QueueHandler
     }
 
 }
-
index ef7719a40c3861513549b11dc6096e89d25d56b5..631ebc7d86b350db77bda77f2b1d9473940c4c2d 100644 (file)
@@ -31,10 +31,10 @@ class Salmon
     const REL_SALMON = 'salmon';
     const REL_MENTIONED = 'mentioned';
 
-    // XXX: these are deprecated 
+    // XXX: these are deprecated
     const NS_REPLIES = "http://salmon-protocol.org/ns/salmon-replies";
     const NS_MENTIONS = "http://salmon-protocol.org/ns/salmon-mention";
-    
+
     /**
      * Sign and post the given Atom entry as a Salmon message.
      *
@@ -87,9 +87,10 @@ class Salmon
                 // No keypair yet, let's generate one.
                 $magickey = new Magicsig();
                 $magickey->generate($user->id);
-            } 
+            }
         } else {
-            throw new Exception("Salmon invalid actor for signing");
+            // @todo i18n FIXME: added i18n and use sprintf when using parameters.
+            throw new Exception("Salmon invalid actor for signing.");
         }
 
         try {
@@ -104,7 +105,7 @@ class Salmon
     public function verifyMagicEnv($text)
     {
         $magic_env = new MagicEnvelope();
-        
+
         $env = $magic_env->parse($text);
 
         return $magic_env->verify($env);
index 9d6c6b269a5744e2b292f3a6b5ed5db15ea44609..5fdb11abe40be4d91b6af9e5616cab7f887d6ee2 100644 (file)
@@ -42,7 +42,7 @@ class SalmonAction extends Action
         }
 
         if (empty($_SERVER['CONTENT_TYPE']) || $_SERVER['CONTENT_TYPE'] != 'application/magic-envelope+xml') {
-            $this->clientError(_m('Salmon requires application/magic-envelope+xml'));
+            $this->clientError(_m('Salmon requires "application/magic-envelope+xml".'));
         }
 
         $xml = file_get_contents('php://input');
index 7eeb5f8e9c1f54988e19d5dcc5c566b2fddc7264..56d3c9eff2e21a702e45787d30300da27292baa7 100644 (file)
@@ -36,7 +36,7 @@ class SalmonQueueHandler extends QueueHandler
         assert(is_string($data['entry']));
 
         $actor = Profile::staticGet($data['actor']);
-        
+
         $salmon = new Salmon();
         $salmon->post($data['salmonuri'], $data['entry'], $actor);
 
index a10b9f42728c72fd9722f24d2537bad66a092907..145cd64cb4e92ddb42d5fd77b8e8b6a81c1ab562 100644 (file)
 class XRD
 {
     const XML_NS = 'http://www.w3.org/2000/xmlns/';
-    
+
     const XRD_NS = 'http://docs.oasis-open.org/ns/xri/xrd-1.0';
 
     const HOST_META_NS = 'http://host-meta.net/xrd/1.0';
-    
+
     public $expires;
 
     public $subject;
@@ -43,11 +43,11 @@ class XRD
     public $host;
 
     public $alias = array();
-    
+
     public $types = array();
-    
+
     public $links = array();
-    
+
     public static function parse($xml)
     {
         $xrd = new XRD();
@@ -61,11 +61,11 @@ class XRD
         error_reporting($old);
 
         if (!$ok) {
-            throw new Exception("Invalid XML");
+            throw new Exception("Invalid XML.");
         }
         $xrd_element = $dom->getElementsByTagName('XRD')->item(0);
         if (!$xrd_element) {
-            throw new Exception("Invalid XML, missing XRD root");
+            throw new Exception("Invalid XML, missing XRD root.");
         }
 
         // Check for host-meta host
@@ -86,7 +86,7 @@ class XRD
             case 'Subject':
                 $xrd->subject = $node->nodeValue;
                 break;
-                
+
             case 'Alias':
                 $xrd->alias[] = $node->nodeValue;
                 break;
@@ -114,7 +114,7 @@ class XRD
         if ($this->host) {
             $xs->element('hm:Host', array('xmlns:hm' => XRD::HOST_META_NS), $this->host);
         }
-        
+
         if ($this->expires) {
             $xs->element('Expires', null, $this->expires);
         }
@@ -139,7 +139,7 @@ class XRD
             }
             $xs->elementEnd('Link');
         }
-        
+
         $xs->elementEnd('XRD');
 
         return $xs->getString();
@@ -149,7 +149,7 @@ class XRD
     {
         return array();
     }
-    
+
     function parseLink($element)
     {
         $link = array();
@@ -169,4 +169,3 @@ class XRD
         return $link;
     }
 }
-
index d8cf648d6ded9cf5fa7c1c4b80f479e28308a898..91bb87cc2306c5880ab2f845c834d11bf54ad202 100644 (file)
@@ -26,13 +26,12 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
 
 class XrdAction extends Action
 {
-
     public $uri;
-    
+
     public $user;
 
     public $xrd;
-    
+
     function handle()
     {
         $nick =  $this->user->nickname;
index 6522ca240ab1be1057d70342828257dbd5864716..4b6ad08a31c9f8e795bc543de4b8c641b60d6797 100644 (file)
@@ -77,7 +77,7 @@ while ($oprofile->fetch()) {
         echo "$uri matched query, but we don't recognize it.\n";
         continue;
     }
-    
+
     if ($dry) {
         echo " - skipping\n";
     } else {
@@ -93,4 +93,3 @@ if ($count && $dry) {
 } else {
     echo "done.\n";
 }
-
index 5e3ccd433a3da082d982e3086763b25dc752a101..82a1c65865d849b82834a7dd02d17051a7ca3059 100644 (file)
@@ -86,4 +86,3 @@ if ($skip || $count) {
 }
 
 Event::handle('StartFeedSubReceive', array($sub, $feed));
-
index ff0d86d37984faf17e668edfc106f95cc445b907..052cca1467af59e2df1d4f712ecc8ea696be34b7 100644 (file)
@@ -49,7 +49,7 @@ try {
         $nickname = get_option_value('n', 'nickname');
         $user = User::staticGet('nickname', $nickname);
         if (empty($user)) {
-            throw new Exception("Can't find user with nickname '$nickname'");
+            throw new Exception("Can't find user with nickname '$nickname'.");
         }
         updateOStatus($user);
     } else if (have_option('a', 'all')) {
index 0e6354a867ed63056ff6ae4d1862574754bdde8b..3be4bf736c704f2ab58c307f75c501e612fbc539 100644 (file)
@@ -53,7 +53,7 @@ class FeedDiscoveryTest extends PHPUnit_Framework_TestCase
 </style>
 
 <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://leuksman.com/log/xmlrpc.php?rsd" />
-<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://leuksman.com/log/wp-includes/wlwmanifest.xml" /> 
+<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://leuksman.com/log/wp-includes/wlwmanifest.xml" />
 <link rel='index' title='leĊ­ksman' href='http://leuksman.com/log' />
 <meta name="generator" content="WordPress 2.8.6" />
 </head>
index 24b4b1660af84f2108cae8484815405919b17989..c2c9a5d97b5c05276a58e263590c74b42dc4718f 100644 (file)
@@ -500,7 +500,7 @@ class SNTestClient extends TestBase
         $me = $this->getProfileUri();
         return $this->checkSubscription($profile_uri, $me);
     }
-    
+
     protected function checkSubscription($subscriber, $subscribed)
     {
         // Using FOAF as the API methods for checking the social graph
@@ -552,4 +552,3 @@ $b = $args[1];
 
 $tester = new OStatusTester($a, $b);
 $tester->run();
-