]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Prefer local URLs for all locally generated notices.
authorMikael Nordfeldth <mmn@hethane.se>
Fri, 23 Jan 2015 11:37:27 +0000 (12:37 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Fri, 23 Jan 2015 11:37:27 +0000 (12:37 +0100)
classes/Notice.php

index 20374e0e2e06233ed03c9298aedb58d51f0ff27f..e15b6cbcb4ecb84a2bc977b2cd3833e478256efc 100644 (file)
@@ -284,11 +284,11 @@ class Notice extends Managed_DataObject
         switch (true) {
         case common_valid_http_url($this->url): // should we allow non-http/https URLs?
             return $this->url;
+        case !$this->isLocal() && common_valid_http_url($this->uri): // Sometimes we only have the URI for remote posts.
+            return $this->uri;
         case $this->isLocal():
             // let's generate a valid link to our locally available notice on demand
             return common_local_url('shownotice', array('notice' => $this->id), null, null, false);
-        case common_valid_http_url($this->uri):
-            return $this->uri;
         default:
             common_debug('No URL available for notice: id='.$this->id);
             throw new InvalidUrlException($this->url);