We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 7aa9a69c authored by mattl's avatar mattl

Link to attachment page instead of big-ass image

parent e4f688fc
...@@ -516,6 +516,11 @@ class File extends Managed_DataObject ...@@ -516,6 +516,11 @@ class File extends Managed_DataObject
return $filepath; return $filepath;
} }
public function getAttachmentUrl()
{
return common_local_url('attachment', array('attachment'=>$this->getID()));
}
public function getUrl($prefer_local=true) public function getUrl($prefer_local=true)
{ {
if ($prefer_local && !empty($this->filename)) { if ($prefer_local && !empty($this->filename)) {
......
...@@ -491,7 +491,7 @@ class ActivityObject ...@@ -491,7 +491,7 @@ class ActivityObject
$object->type = self::mimeTypeToObjectType($file->mimetype); $object->type = self::mimeTypeToObjectType($file->mimetype);
$object->id = TagURI::mint(sprintf("file:%d", $file->id)); $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) { if ($file->title) {
$object->title = $file->title; $object->title = $file->title;
......
...@@ -87,8 +87,8 @@ class AttachmentListItem extends Widget ...@@ -87,8 +87,8 @@ class AttachmentListItem extends Widget
function linkAttr() { function linkAttr() {
return array('class' => 'attachment', return array('class' => 'attachment',
'href' => $this->attachment->getUrl(false), 'href' => $this->attachment->getAttachmentUrl(),
'id' => 'attachment-' . $this->attachment->id, 'id' => 'attachment-' . $this->attachment->getID(),
'title' => $this->linkTitle()); 'title' => $this->linkTitle());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment