diff options
author | wurstsalat <mailtrash@posteo.de> | 2022-09-29 19:53:06 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2022-09-29 20:18:37 +0300 |
commit | c947c797637a648d22cef70f9f08c912b7818436 (patch) | |
tree | 6709ea0eac4025b850e2e7114636629bcc443bef | |
parent | 2f4fc20518caacedca808f7e0f6341ca0b00a4e5 (diff) |
perf: Styling: Parse emojis for Darwin only
-rw-r--r-- | gajim/common/styling.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gajim/common/styling.py b/gajim/common/styling.py index fce6389ad..0cbb66df7 100644 --- a/gajim/common/styling.py +++ b/gajim/common/styling.py @@ -18,6 +18,7 @@ from typing import Union from typing import Match import string +import sys import re from dataclasses import dataclass from dataclasses import field @@ -208,7 +209,11 @@ def process(text: Union[str, bytes], level: int = 0) -> ParsingResult: for line in block.text.splitlines(keepends=True): block.spans += _parse_line(line, offset, offset_bytes) block.uris += _parse_uris(line, offset, offset_bytes) - block.emojis += _parse_emojis(line, offset) + if sys.platform == 'darwin': + # block.emojis is used for replacing emojis with Gtk.Images + # Necessary for MessageTextview (darwin) only + block.emojis += _parse_emojis(line, offset) + offset += len(line) offset_bytes += len(line.encode()) |