This commit is contained in:
Yann Leboulanger 2005-08-04 17:05:39 +00:00
parent ecb476d796
commit ab3263c5ba
2 changed files with 10 additions and 2 deletions

View File

@ -95,7 +95,8 @@ def get_first_contact_instance_from_jid(account, jid):
#FIXME: problem see comment in next line
room, nick = \
get_room_and_nick_from_fjid(jid) # if we ban/kick we now real jid
if nick in gc_contacts[account][room]:
if gc_contacts[account].has_key(room) and \
nick in gc_contacts[account][room]:
contact = gc_contacts[account][room][nick]
return contact

View File

@ -549,9 +549,16 @@ class TabbedChatWindow(chat.Chat):
"""Send the given message to the active tab"""
if not message:
return
jid = self.get_active_jid()
contact = gajim.get_first_contact_instance_from_jid(self.account, jid)
if contact is None:
# contact was from pm in MUC, and left the room, or we left the room
room, nick = gajim.get_room_and_nick_from_fjid(jid)
dialogs.ErrorDialog(_('Sending private message failed'),
_('You are no longer in room "%s" or "%s" has left.') % \
(room, nick)).get_response()
return
conversation_textview = self.xmls[jid].get_widget('conversation_textview')
message_textview = self.xmls[jid].get_widget('message_textview')
message_buffer = message_textview.get_buffer()