Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
c6ad7550 by wurstsalat at 2023-04-23T18:58:43+02:00
imprv: GroupchatRoster: Highlight own nick and sort it to the top
Fixes #11431
- - - - -
1 changed file:
- gajim/gtk/groupchat_roster.py
Changes:
=====================================
gajim/gtk/groupchat_roster.py
=====================================
@@ -36,6 +36,7 @@
from gajim.common.helpers import get_uf_affiliation
from gajim.common.helpers import get_uf_role
from gajim.common.helpers import jid_is_blocked
+from gajim.common.i18n import p_
from gajim.common.modules.contacts import GroupchatContact
from gajim.gtk.builder import get_builder
@@ -488,10 +489,15 @@ def _tree_compare_iters(self,
nick1 = model[iter1][Column.NICK_OR_GROUP]
nick2 = model[iter2][Column.NICK_OR_GROUP]
+ assert self._contact is not None
+ our_nick = self._contact.nickname
+ if our_nick in (nick1, nick2):
+ # Always show our nickname at the top
+ return -1 if our_nick == nick1 else 1
+
if not app.settings.get('sort_by_show_in_muc'):
return locale.strcoll(nick1.lower(), nick2.lower())
- assert self._contact is not None
contact1 = self._contact.get_resource(nick1)
contact2 = self._contact.get_resource(nick2)
@@ -574,6 +580,9 @@ def _draw_contact(self, nick: str) -> None:
self._draw_avatar(contact)
name = GLib.markup_escape_text(contact.name)
+ self_contact = self._contact.get_self()
+ if self_contact is not None and self_contact.name == nick:
+ name = p_('own nickname in group chat', '%s (You)' % nick)
# Strike name if blocked
fjid = f'{self._contact.jid}/{nick}'
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/c6ad7550db227b45c823bd9cebabed8b5cc58cbb
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/c6ad7550db227b45c823bd9cebabed8b5cc58cbb
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