Fix traceback when right click on email in history viewer. Fixes #5131

This commit is contained in:
Yann Leboulanger 2009-07-09 19:06:08 +02:00
parent e01cb71d8f
commit 4917ffdbcc
1 changed files with 6 additions and 5 deletions

View File

@ -873,12 +873,13 @@ class ConversationTextview(gobject.GObject):
self.handlers[id_] = childs[6]
allow_add = False
c = gajim.contacts.get_first_contact_from_jid(self.account, text)
if c and not gajim.contacts.is_pm_from_contact(self.account, c):
if _('Not in Roster') in c.groups:
if self.account:
c = gajim.contacts.get_first_contact_from_jid(self.account, text)
if c and not gajim.contacts.is_pm_from_contact(self.account, c):
if _('Not in Roster') in c.groups:
allow_add = True
else: # he or she's not at all in the account contacts
allow_add = True
else: # he or she's not at all in the account contacts
allow_add = True
if allow_add:
id_ = childs[7].connect('activate', self.on_add_to_roster_activate,