Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
78319461 by wurstsalat at 2022-09-18T11:41:42+02:00
cfix: ChatBanner: Escape contact name for title and tooltip

Fixes #11154

- - - - -


1 changed file:

- gajim/gtk/chat_banner.py


Changes:

=====================================
gajim/gtk/chat_banner.py
=====================================
@@ -17,6 +17,7 @@
 from typing import Any
 from typing import Optional
 
+from gi.repository import GLib
 from gi.repository import Gtk
 
 import cairo
@@ -246,7 +247,7 @@ def _update_content(self) -> None:
         assert self._contact is not None
         assert self._client is not None
 
-        name = self._contact.name
+        name = GLib.markup_escape_text(self._contact.name)
 
         if self._contact.jid.bare_match(self._client.get_own_jid()):
             name = _('Note to myself')
@@ -254,7 +255,7 @@ def _update_content(self) -> None:
         if self._contact.is_pm_contact:
             gc_contact = self._client.get_module('Contacts').get_contact(
                 self._contact.jid.bare)
-            name = f'{name} ({gc_contact.name})'
+            name = f'{name} ({GLib.markup_escape_text(gc_contact.name)})'
 
         label_text = f'<span>{name}</span>'
         label_tooltip = name
@@ -273,7 +274,7 @@ def _update_content(self) -> None:
             label_tooltip = f'{name} {chatstate}'
 
         self._ui.name_label.set_markup(label_text)
-        self._ui.name_label.set_tooltip_text(label_tooltip)
+        self._ui.name_label.set_tooltip_markup(label_tooltip)
 
         if isinstance(self._contact, GroupchatContact):
             self_contact = self._contact.get_self()



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/78319461b2be41b32ec62d6343f7184aec5c37a5

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/78319461b2be41b32ec62d6343f7184aec5c37a5
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to