]> git.mxchange.org Git - friendica.git/commitdiff
Issue 8458: Display big emojis
authorMichael <heluecht@pirati.ca>
Sun, 17 May 2020 16:55:54 +0000 (16:55 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 17 May 2020 16:55:54 +0000 (16:55 +0000)
Fixes #8458

src/Content/Text/BBCode.php
static/defaults.config.php

index 98c1552930d702c504067218b8c822282d350965..508a325ca1bb2516db9557b268a0dda07059b107 100644 (file)
@@ -1724,7 +1724,15 @@ class BBCode
 
                // Replace non graphical smilies for external posts
                if (!$nosmile && !$for_plaintext) {
-                       $text = Smilies::replace($text);
+                       $oldtext = $text;
+                       $text = Smilies::replace($text);                        
+                       if (DI::config()->get('system', 'big_emojis') && ($simple_html != self::DIASPORA) && ($oldtext != $text)) {
+                               $conv = html_entity_decode(str_replace([' ', "\n", "\r"], '', $text));
+                               // Emojis are always 4 byte Unicode characters
+                               if (strlen($conv) / mb_strlen($conv) == 4) {
+                                       $text = '<span style="font-size: xx-large; line-height: initial;">' . $text . '</span>';
+                               }
+                       }
                }
 
                if (!$for_plaintext) {
index 4ef006496dbd4b7224663eca7ed0db6e6002c46b..a1d50bb84f53d1299c87a0a13d1b93d365e2068e 100644 (file)
@@ -103,6 +103,10 @@ return [
                // chose "Remember me" when logging in is considered logged out.
                'auth_cookie_lifetime' => 7,
 
+               // big_emojis (Boolean)
+               // Display "Emoji Only" posts in big.
+               'big_emojis' => false,
+
                // block_local_dir (Boolean)
                // Deny public access to the local user directory.
                'block_local_dir' => false,