diff --git a/src/chat_control.py b/src/chat_control.py index 27947e4a7..f577571d4 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -2344,6 +2344,9 @@ class ChatControl(ChatControlBase): elif isinstance(self.session, ArchivingStanzaSession): self.print_archiving_session_details() + def get_our_nick(self): + return gajim.nicks[self.account] + def print_conversation(self, text, frm='', tim=None, encrypted=False, subject=None, xhtml=None, simple=False, xep0184_id=None, displaymarking=None): @@ -2400,7 +2403,7 @@ class ChatControl(ChatControlBase): name = contact.get_shown_name() else: kind = 'outgoing' - name = gajim.nicks[self.account] + name = self.get_our_nick() if not xhtml and not (encrypted and self.gpg_is_active) and \ gajim.config.get('rst_formatting_outgoing_messages'): from common.rst_xhtml_generator import create_xhtml @@ -2827,7 +2830,7 @@ class ChatControl(ChatControlBase): if row[1] in (constants.KIND_CHAT_MSG_SENT, constants.KIND_SINGLE_MSG_SENT): kind = 'outgoing' - name = gajim.nicks[self.account] + name = self.get_our_nick() elif row[1] in (constants.KIND_SINGLE_MSG_RECV, constants.KIND_CHAT_MSG_RECV): kind = 'incoming' diff --git a/src/groupchat_control.py b/src/groupchat_control.py index afa873b53..be84c4cb8 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -138,12 +138,12 @@ class PrivateChatControl(ChatControl): def __init__(self, parent_win, gc_contact, contact, account, session): room_jid = gc_contact.room_jid - room_ctrl = gajim.interface.msg_win_mgr.get_gc_control(room_jid, + self.room_ctrl = gajim.interface.msg_win_mgr.get_gc_control(room_jid, account) if room_jid in gajim.interface.minimized_controls[account]: - room_ctrl = gajim.interface.minimized_controls[account][room_jid] - if room_ctrl: - self.room_name = room_ctrl.name + self.room_ctrl = gajim.interface.minimized_controls[account][room_jid] + if self.room_ctrl: + self.room_name = self.room_ctrl.name else: self.room_name = room_jid self.gc_contact = gc_contact @@ -154,6 +154,9 @@ class PrivateChatControl(ChatControl): gajim.ged.register_event_handler('gc-presence-received', ged.GUI1, self._nec_gc_presence_received) + def get_our_nick(self): + return self.room_ctrl.nick + def shutdown(self): super(PrivateChatControl, self).shutdown() gajim.ged.remove_event_handler('caps-received', ged.GUI1,