Daniel Brötzmann pushed to branch master at gajim / gajim
Commits: b45ab768 by wurstsalat at 2022-02-20T14:44:50+01:00 Respect timestamp formatting on message copy
- - - - -
1 changed file:
- gajim/gtk/conversation/rows/message.py
Changes:
===================================== gajim/gtk/conversation/rows/message.py ===================================== @@ -35,6 +35,7 @@ from gajim.common.const import Trust from gajim.common.const import TRUST_SYMBOL_DATA from gajim.common.helpers import AdditionalDataDict +from gajim.common.helpers import from_one_line from gajim.common.helpers import get_group_chat_nick from gajim.common.helpers import get_muc_context from gajim.common.helpers import message_needs_highlight @@ -309,10 +310,12 @@ def is_mergeable(self, message: MessageRow) -> bool: return abs(message.timestamp - self.timestamp) < MERGE_TIMEFRAME
def on_copy_message(self, _widget: Gtk.Widget) -> None: - timestamp = self.timestamp.strftime('%x, %X') + time_format = from_one_line(app.settings.get('chat_timestamp_format')) + timestamp_formatted = self.timestamp.strftime(time_format) + clip = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD) text = self._message_widget.get_text() - clip.set_text(f'{timestamp} - {self.name}: {text}', -1) + clip.set_text(f'{timestamp_formatted} - {self.name}: {text}', -1)
def on_quote_message(self, _widget: Gtk.Widget) -> None: self.emit('quote', self._message_widget.get_text())
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/b45ab768f7f923e228fe10074b0495072...