we now create Contact and GC_Contact instances from Contacts class in dialog.py
This commit is contained in:
parent
31efa00b85
commit
15e4a9642f
|
@ -43,7 +43,6 @@ except:
|
||||||
from filetransfers_window import FileTransfersWindow
|
from filetransfers_window import FileTransfersWindow
|
||||||
from gajim_themes_window import GajimThemesWindow
|
from gajim_themes_window import GajimThemesWindow
|
||||||
from advanced import AdvancedConfigurationWindow
|
from advanced import AdvancedConfigurationWindow
|
||||||
from gajim import Contact
|
|
||||||
from common import gajim
|
from common import gajim
|
||||||
from common import helpers
|
from common import helpers
|
||||||
from common import i18n
|
from common import i18n
|
||||||
|
@ -941,14 +940,15 @@ class PopupNotificationWindow:
|
||||||
if self.msg_type.find('file') != 0:
|
if self.msg_type.find('file') != 0:
|
||||||
if self.msg_type == 'pm':
|
if self.msg_type == 'pm':
|
||||||
room_jid, nick = self.jid.split('/', 1)
|
room_jid, nick = self.jid.split('/', 1)
|
||||||
show = gajim.gc_contacts[self.account][room_jid][nick].show
|
gc_contact = gajim.contacts.get_gc_contact(self.account,
|
||||||
contact = Contact(jid = self.jid, name = nick, groups = ['none'],
|
room_jid, nick)
|
||||||
show = show, sub = 'none')
|
contact = gajim.contacts.contact_from_gc_contact(gc_contact)
|
||||||
else:
|
else:
|
||||||
contact = Contact(jid = self.jid, name = self.jid.split('@')[0],
|
contact = gajim.contacts.create_contact(jid = self.jid,
|
||||||
|
name = self.jid.split('@')[0],
|
||||||
groups = [_('not in the roster')], show = 'not in the roster',
|
groups = [_('not in the roster')], show = 'not in the roster',
|
||||||
status = _('not in the roster'), sub = 'none', keyID = keyID)
|
status = '', sub = 'none', keyID = keyID)
|
||||||
gajim.contacts[self.account][self.jid] = [contact]
|
gajim.contacts.add_contact(self.account, contact)
|
||||||
gajim.interface.roster.add_contact_to_roster(contact.jid,
|
gajim.interface.roster.add_contact_to_roster(contact.jid,
|
||||||
self.account)
|
self.account)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue