Fixed The native emojis of the device are shown and not those of JoyPixels.

šŸ§Œ

I have JoyPixels selected on my site, and when using the above icon, it does the same thing on my Mac Mini (but does show up on the iPhone).

Screen Shot 2022-12-10 at 10.37.43 AM.png

By the descriptor... I would assume that it would use the JoyPixels emoji if the device did not support that emoji natively?
JoyPixels does support the troll emoji in the 7.0 (and I'm sure earlier)
 
Last edited:
@Chris D
This method converts emoji to image name and works much faster than JoyPixels array_search lookup .. it would be great if you take that approach .. tested and works perfect with both emojione and twemoji
PHP:
    public function formatEmojiToImage($string)
    {
        if ($this->config['style'] === 'native') {
            return $string;
        }

        return preg_replace_callback('/' . $this->client->unicodeRegexp . '/u', function ($match) {

            if ($this->config['style'] === 'emojione') {
                $chars = mb_str_split($match[0]);
                $codepoints = array_map(static function (string $code): string {
                    return str_pad(dechex(mb_ord($code, 'UTF-8')), 4, 0, STR_PAD_LEFT);
                }, $chars);
                $codepoints = array_diff($codepoints, ['fe0f', '200d']);
                $filename = implode('-', $codepoints);
            } elseif ($this->config['style'] === 'twemoji') {
                $chars = mb_str_split($match[0]);
                $codepoints = array_map(static function (string $code): string {
                    return dechex(mb_ord($code));
                }, $chars);
                $codepoints[0] = ltrim($codepoints[0], '0');
                $codepoints = !in_array('200d', $codepoints) ? array_diff($codepoints, ['fe0f']) : $codepoints;
                $filename = implode('-', $codepoints);
            } else {
                /** shouldn't be here already */
                return $match[0];
            }

            return '<img class="smilie smilie--emoji" loading="lazy"'
                . ' alt="' . htmlspecialchars($match[0]) . '" title="' . htmlspecialchars($match[0]) . '"'
                . ' src="' . htmlspecialchars($this->config['path'] . $filename) . '.png"'
                . ' />';

        }, $string);
    }
 
when is the patch happening?
WIR (When it's ready)
You will simply have to wait until the next bugfix version is released... depending on how quickly the developers work and the priority.. it could be tomorrow... and it could be a few months away. They aren't going to release a bug-fix version for every single but... they will have to accumulate.
 
Any update on when this will be fixed? This is a very visible issue and a number of my members are complaining and asking about this.

@K a M a L I see you posted a patch above. Can you please tell me how to install this?
 
It's not an "install"... .it's an edit of a core PHP file that is related to the script. If you have nerve enough to manually edit the PHP files on untested code (by anyone other than the person posting it) then I think the file is
/src/XF/Str/EmojiFormatter.php at around line 29.
Got it. Thank you so much! :)
 
Could you implement that in 2.2.13? That would be great.
I've got a feeling it's already on the "to fix" list... it's just the impatient that have to have it now that the tweak of the PHP file applies to. Me personally... I don't want to be warted by a warning on my ACP about files not matching. I can simply wait until the fix is pushed out.
 
Back
Top Bottom