From 59b2bf1d313416a79940f9cb541fb57306c54aae Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 4 Oct 2005 10:59:11 +0000 Subject: [PATCH] xmpp code in connection.py instead of gajim.py --- src/common/connection.py | 7 ++++++- src/gajim.py | 16 +++------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 16c390365..1263319ed 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -311,7 +311,12 @@ class Connection: log_msgtxt = _('Subject: %s\n%s') % (subject, msgtxt) gajim.logger.write('incoming', log_msgtxt, frm, tim = tim) if invite is not None: - self.dispatch('GC_INVITATION',(frm, invite)) + item = invite.getTag('invite') + jid_from = item.getAttr('from') + reason = item.getTagData('reason') + item = invite.getTag('password') + password = invite.getTagData('password') + self.dispatch('GC_INVITATION',(frm, jid_from, reason, password)) else: self.dispatch('MSG', (frm, msgtxt, tim, encrypted, mtype, subject, None)) diff --git a/src/gajim.py b/src/gajim.py index 0465cc784..92098fe5c 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -713,19 +713,9 @@ class Interface: config.GroupchatConfigWindow(self, account, jid, array[1]) def handle_event_gc_invitation(self, account, array): - #('GC_INVITATION', (unicode(msg.getFrom()), invite)) - items = array[1].getChildren() - password = None - reason = None - for item in items: - if item.getName() == 'invite': - contact_jid = item.getAttr('from') - reason = item.getTagData('reason') - if item.getName() == 'password': - password = item.getData() - - dialogs.InvitationReceivedDialog(self, account, array[0], contact_jid, - password, reason) + #('GC_INVITATION', (room_jid, jid_from, reason, password)) + dialogs.InvitationReceivedDialog(self, account, array[0], array[1], + array[3], array[2]) def handle_event_bad_passphrase(self, account, array): use_gpg_agent = gajim.config.get('use_gpg_agent')