From cf247f36e34f4d11dffec1a66bb799402e96c7c7 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 5 Jan 2006 19:59:35 +0000 Subject: [PATCH] check correctly if a contact leaves the groupchat --- src/tabbed_chat_window.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/tabbed_chat_window.py b/src/tabbed_chat_window.py index e90830b86..31273a29e 100644 --- a/src/tabbed_chat_window.py +++ b/src/tabbed_chat_window.py @@ -745,13 +745,16 @@ class TabbedChatWindow(chat.Chat): jid = self.get_active_jid() contact = gajim.contacts.get_first_contact_from_jid(self.account, jid) if contact is None: - # contact was from pm in MUC, and left the room, or we left the room + # contact was from pm in MUC room, nick = gajim.get_room_and_nick_from_fjid(jid) - dialogs.ErrorDialog(_('Sending private message failed'), - #in second %s code replaces with nickname - _('You are no longer in room "%s" or "%s" has left.') % \ - (room, nick)).get_response() - return + gc_contact = gajim.contacts.get_gc_contact(self.account, room, nick) + if not gc_contact: + # contact left the room, or we left the room + dialogs.ErrorDialog(_('Sending private message failed'), + #in second %s code replaces with nickname + _('You are no longer in room "%s" or "%s" has left.') % \ + (room, nick)).get_response() + return conv_textview = self.conversation_textviews[jid] message_textview = self.message_textviews[jid]