]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
When too-long messages come in via OStatus, mark the attachment link up as a "more...
authorBrion Vibber <brion@pobox.com>
Wed, 17 Mar 2010 19:34:35 +0000 (12:34 -0700)
committerBrion Vibber <brion@pobox.com>
Wed, 17 Mar 2010 19:34:35 +0000 (12:34 -0700)
plugins/OStatus/classes/Ostatus_profile.php

index 73f5d23229c705df09405a8e34e25e3ad8e3d0c3..7b18fed9c848173384769e8ff3eef0c263825603 100644 (file)
@@ -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>';
             }
         }