]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Link to attachment page instead of big-ass image
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 1 May 2016 09:26:28 +0000 (11:26 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 1 May 2016 09:35:51 +0000 (11:35 +0200)
classes/File.php
lib/activityobject.php
lib/attachmentlistitem.php

index 9643b78f189ef6c8ed8f6a7389c6a23c0b4c52d3..46d4d5498dc2980a442d67f100371a2edd900feb 100644 (file)
@@ -516,6 +516,11 @@ class File extends Managed_DataObject
         return $filepath;
     }
 
+    public function getAttachmentUrl()
+    {
+        return common_local_url('attachment', array('attachment'=>$this->getID()));
+    }
+
     public function getUrl($prefer_local=true)
     {
         if ($prefer_local && !empty($this->filename)) {
index 87eea13727e3261c8829a8459dad19b42113caab..ca6390b725331704f878d152367f1a3fb8c0cead 100644 (file)
@@ -491,7 +491,7 @@ class ActivityObject
 
             $object->type = self::mimeTypeToObjectType($file->mimetype);
             $object->id   = TagURI::mint(sprintf("file:%d", $file->id));
-            $object->link = common_local_url('attachment', array('attachment' => $file->id));
+            $object->link = $file->getAttachmentUrl();
 
             if ($file->title) {
                 $object->title = $file->title;
index 6ee3c7087b43d5d573489974693ed89c8bfcf9fb..dc22c8af2915992d6907e4db7bc1c377a04e4000 100644 (file)
@@ -87,8 +87,8 @@ class AttachmentListItem extends Widget
 
     function linkAttr() {
         return array('class' => 'attachment',
-                     'href' => $this->attachment->getUrl(false),
-                     'id' => 'attachment-' . $this->attachment->id,
+                     'href' => $this->attachment->getAttachmentUrl(),
+                     'id' => 'attachment-' . $this->attachment->getID(),
                      'title' => $this->linkTitle());
     }