Daniel Brötzmann pushed to branch storage at gajim / gajim
Commits:
0d6b1a04 by wurstsalat at 2024-03-25T22:59:17+01:00
imprv: Chat: Unset read marker for corrected messages
- - - - -
2 changed files:
- gajim/gtk/conversation/rows/read_marker.py
- gajim/gtk/conversation/view.py
Changes:
=====================================
gajim/gtk/conversation/rows/read_marker.py
=====================================
@@ -42,8 +42,8 @@ def _on_nickname_update(self,
text = _('%s has read up to this point') % contact.name
self.label.set_text(text)
- def set_timestamp(self, timestamp: datetime) -> None:
- if timestamp <= self._last_incoming_timestamp:
+ def set_timestamp(self, timestamp: datetime, force: bool = False) -> None:
+ if timestamp <= self._last_incoming_timestamp and not force:
return
self.timestamp = timestamp
=====================================
gajim/gtk/conversation/view.py
=====================================
@@ -797,8 +797,18 @@ def update_avatars(self) -> None:
def correct_message(self, db_row: Message) -> None:
assert db_row.id is not None
message_row = self._get_row_by_message_id(db_row.id)
- if message_row is not None:
- message_row.update_with_content(db_row)
+ if message_row is None:
+ return
+
+ message_row.update_with_content(db_row)
+
+ assert self._read_marker_row is not None
+ timestamp = message_row.timestamp + timedelta(microseconds=1)
+ if self._read_marker_row.timestamp == timestamp:
+ # This exact message has been marked as read
+ # -> set read marker to before this message
+ self._read_marker_row.set_timestamp(
+ message_row.timestamp - timedelta(microseconds=1), force=True)
def show_message_retraction(self, stanza_id: str, text: str) -> None:
message_row = self.get_row_by_stanza_id(stanza_id)
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/0d6b1a04c991465bd4a4a70af133265fb0624df9
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/0d6b1a04c991465bd4a4a70af133265fb0624df9
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]