diff --git a/src/common/zeroconf/roster_zeroconf.py b/src/common/zeroconf/roster_zeroconf.py index 7924e70f7..269d3dbb2 100644 --- a/src/common/zeroconf/roster_zeroconf.py +++ b/src/common/zeroconf/roster_zeroconf.py @@ -47,8 +47,12 @@ class Roster: def setItem(self, jid, name = '', groups = ''): #print 'roster_zeroconf.py: setItem %s' % jid + contact = self.zeroconf.get_contact(jid) + if not contact: + return + (service_jid, domain, interface, protocol, host, address, port, bare_jid, txt) \ - = self.zeroconf.get_contact(jid) + = contact self._data[jid]={} self._data[jid]['ask'] = 'no' #? diff --git a/src/roster_window.py b/src/roster_window.py index 7b1478daa..baa106cb7 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -1137,6 +1137,11 @@ class RosterWindow: if info.has_key(contact.jid): info[contact.jid].window.present() else: + contact = gajim.contacts.get_first_contact_from_jid(account, + contact.jid) + if contact.show in ('offline', 'error'): + # don't show info on offline contacts + return info[contact.jid] = vcard.ZeroconfVcardWindow(contact, account) @@ -1454,8 +1459,9 @@ class RosterWindow: send_file_menuitem.set_no_show_all(True) rename_menuitem.connect('activate', self.on_rename, iter, tree_path) - if contact.show == 'offline': + if contact.show in ('offline', 'error'): information_menuitem.set_sensitive(False) + send_file_menuitem.set_sensitive(False) else: information_menuitem.connect('activate', self.on_info_zeroconf, contact, account)