diff --git a/src/dialogs.py b/src/dialogs.py index c99674b976f4ab015c59428a98a638e4f98bf6a2..c761e37cc54ec5616a02052f1ad7b377028b9784 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -4463,14 +4463,16 @@ class PrivacyListsWindow: PrivacyListWindow(self.account, name, 'EDIT') class InvitationReceivedDialog: - def __init__(self, account, room_jid, contact_jid, password=None, - comment=None, is_continued=False): + def __init__(self, account, room_jid, contact_fjid, password=None, + comment=None, is_continued=False): self.room_jid = room_jid self.account = account self.password = password self.is_continued = is_continued - self.contact_jid = contact_jid + self.contact_fjid = contact_fjid + + jid = gajim.get_jid_without_resource(contact_fjid) pritext = _('''You are invited to a groupchat''') #Don't translate $Contact @@ -4478,8 +4480,8 @@ class InvitationReceivedDialog: sectext = _('$Contact has invited you to join a discussion') else: sectext = _('$Contact has invited you to group chat %(room_jid)s')\ - % {'room_jid': room_jid} - contact = gajim.contacts.get_first_contact_from_jid(account, contact_jid) + % {'room_jid': room_jid} + contact = gajim.contacts.get_first_contact_from_jid(account, jid) contact_text = contact and contact.name or contact_jid sectext = sectext.replace('$Contact', contact_text) @@ -4501,7 +4503,7 @@ class InvitationReceivedDialog: def on_no(text): gajim.connections[account].decline_invitation(self.room_jid, - self.contact_jid, text) + self.contact_fjid, text) YesNoDialog(pritext, sectext, text_label=_('Reason:'), on_response_yes=on_yes, on_response_no=on_no) diff --git a/src/gui_interface.py b/src/gui_interface.py index 89c93b0408107f93281a37fc0a2c0714f5dc675a..a64cb82d959f4b6f519a00be2dcbe1960c67bf51 100644 --- a/src/gui_interface.py +++ b/src/gui_interface.py @@ -628,18 +628,19 @@ class Interface: jid = gajim.get_jid_without_resource(obj.jid_from) account = obj.conn.name if helpers.allow_popup_window(account) or not self.systray_enabled: - dialogs.InvitationReceivedDialog(account, obj.room_jid, jid, - obj.password, obj.reason, is_continued=obj.is_continued) + dialogs.InvitationReceivedDialog(account, obj.room_jid, + obj.jid_from, obj.password, obj.reason, + is_continued=obj.is_continued) return - self.add_event(account, jid, 'gc-invitation', (obj.room_jid, + self.add_event(account, obj.jid_from, 'gc-invitation', (obj.room_jid, obj.reason, obj.password, obj.is_continued)) if helpers.allow_showing_notification(account): path = gtkgui_helpers.get_icon_path('gajim-gc_invitation', 48) event_type = _('Groupchat Invitation') - notify.popup(event_type, jid, account, 'gc-invitation', path, - event_type, obj.room_jid) + notify.popup(event_type, obj.jid_from, account, 'gc-invitation', + path, event_type, obj.room_jid) def forget_gpg_passphrase(self, keyid): if keyid in self.gpg_passphrase: