summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-17 12:34:35 -0700
committerBrion Vibber <brion@pobox.com>2010-03-17 12:34:35 -0700
commit3a72c70b7e560023ecb7439be680942e4d0e6350 (patch)
tree9e6fcb2cad20241797683a9d0d5d2067a4f478ea /plugins
parent67f2f01c5e1cad743e849cdaaaf11deb6e435844 (diff)
When too-long messages come in via OStatus, mark the attachment link up as a "more" link in the HTML output, marked with class="attachment more" so JS code can fold it out smartly. Text output will still include the raw link.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/OStatus/classes/Ostatus_profile.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index 73f5d2322..7b18fed9c 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -547,9 +547,19 @@ class Ostatus_profile extends Memcached_DataObject
$shortSummary = substr($shortSummary,
0,
Notice::maxContent() - (mb_strlen($url) + 2));
- $shortSummary .= '… ' . $url;
- $content = $shortSummary;
- $rendered = common_render_text($content);
+ $shortSummary .= '…';
+ $content = $shortSummary . ' ' . $url;
+
+ // We mark up the attachment link specially for the HTML output
+ // so we can fold-out the full version inline.
+ $rendered = common_render_text($shortSummary) .
+ ' ' .
+ '<a href="' .
+ htmlspecialchars($url) .
+ '" class="attachment more">' .
+ // TRANS: expansion link for too-long remote messages
+ htmlspecialchars(_m('(more)')) .
+ '</a>';
}
}