Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits:
97dfbb01 by Daniel Brötzmann at 2021-02-02T19:42:06+01:00
ChatList: Add group chat nicks
- - - - -
1 changed file:
- gajim/gtk/chat_list.py
Changes:
=====================================
gajim/gtk/chat_list.py
=====================================
@@ -9,6 +9,7 @@
from gajim.common.const import KindConstant
from gajim.common.i18n import _
from gajim.common.helpers import get_groupchat_name
+from gajim.common.helpers import get_group_chat_nick
from gajim.common.helpers import get_uf_relative_time
log = logging.getLogger('gajim.gtk.chatlist')
@@ -167,14 +168,23 @@ def __init__(self, workspace_id, account, jid, type_):
if line is not None and line.message is not None:
one_line = ' '.join(line.message.splitlines())
last_message_label.set_text(one_line)
- nick_label = Gtk.Label(label=_('Me:'))
+ nick_label = Gtk.Label()
nick_label.set_halign(Gtk.Align.START)
nick_label.get_style_context().add_class('small-label')
nick_label.get_style_context().add_class('dim-label')
if line.kind in (KindConstant.CHAT_MSG_SENT,
KindConstant.SINGLE_MSG_SENT):
+ nick_label.set_text(_('Me:'))
last_message_box.add(nick_label)
- # TODO: MUC nick
+ if line.kind == KindConstant.GC_MSG:
+ our_nick = get_group_chat_nick(account, jid)
+ if line.contact_name == our_nick:
+ nick_label.set_text(_('Me:'))
+ else:
+ nick_label.set_text(_('%(muc_nick)s: ') % {
+ 'muc_nick': line.contact_name})
+ last_message_box.add(nick_label)
+
# TODO: file transfers have to be displayed differently
self._timestamp = line.time
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/97dfbb01b552f37cbb1444759e907ce7…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/97dfbb01b552f37cbb1444759e907ce7…
You're receiving this email because of your account on dev.gajim.org.
Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits:
3b4d96a9 by Daniel Brötzmann at 2021-02-01T20:29:45+01:00
ChatList: Group chat avatars and message lines
- - - - -
1 changed file:
- gajim/gtk/chat_list.py
Changes:
=====================================
gajim/gtk/chat_list.py
=====================================
@@ -118,7 +118,7 @@ def __init__(self, workspace_id, account, jid, type_):
contact = app.contacts.get_contact(account, jid)
- if contact:
+ if contact and not contact.is_groupchat:
avatar = app.contacts.get_avatar(account,
contact.jid,
AvatarSize.ROSTER,
@@ -157,7 +157,8 @@ def __init__(self, workspace_id, account, jid, type_):
line = app.storage.archive.get_last_conversation_line(account, jid)
last_message_box = Gtk.Box(spacing=3)
if line is not None and line.message is not None:
- last_message_label.set_text(line.message)
+ one_line = ' '.join(line.message.splitlines())
+ last_message_label.set_text(one_line)
nick_label = Gtk.Label(label=_('Me:'))
nick_label.set_halign(Gtk.Align.START)
nick_label.get_style_context().add_class('small-label')
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/3b4d96a92acfa73fafa512656ba4a06c…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/3b4d96a92acfa73fafa512656ba4a06c…
You're receiving this email because of your account on dev.gajim.org.