Philipp Hörist pushed to branch reactions at gajim / gajim
Commits:
3add1998 by Philipp Hörist at 2024-05-18T19:53:56+02:00
fix: Load reactions correctly for corrections
- - - - -
2 changed files:
- gajim/common/modules/reactions.py
- gajim/gtk/conversation/rows/message.py
Changes:
=====================================
gajim/common/modules/reactions.py
=====================================
@@ -114,13 +114,14 @@ def _process_reaction(
# Check if reactions qualify as emojis.
reactions: list[str] = []
for reaction in list(properties.reactions.emojis)[:10]:
- if emoji.is_emoji(reaction):
- reactions.append(reaction)
+ if not emoji.is_emoji(reaction):
+ self._log.warning(
+ 'Reactions did not qualify as emoji: %s', reaction
+ )
+ continue
+ reactions.append(reaction)
if not reactions:
- self._log.warning(
- 'Reactions did not qualify as emoji: %s',
properties.reactions.emojis
- )
raise NodeProcessed
reaction = mod.Reaction(
@@ -133,6 +134,7 @@ def _process_reaction(
timestamp=timestamp,
)
+ self._log.info('Received reactions: %s', reaction)
app.storage.archive.upsert_row2(reaction)
app.ged.raise_event(
=====================================
gajim/gtk/conversation/rows/message.py
=====================================
@@ -204,8 +204,9 @@ def _set_content(self, message: Message) -> None:
self.set_retracted(get_retraction_text(
message.moderation.by, message.moderation.reason))
- if self._original_message.reactions:
- self._reactions_bar.update_from_reactions(message.reactions)
+ reactions = self._original_message.reactions
+ if reactions:
+ self._reactions_bar.update_from_reactions(reactions)
encryption_data = self._get_encryption_data(message.encryption)
if encryption_data is not None:
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/3add1998acbb49be9b99bbc6ccfa3c1639cd1a62
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/3add1998acbb49be9b99bbc6ccfa3c1639cd1a62
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]