send decline to the same jid (bare or full) from which we received he invite
This commit is contained in:
parent
f790007b06
commit
689f8370b8
2 changed files with 14 additions and 11 deletions
|
@ -4463,14 +4463,16 @@ class PrivacyListsWindow:
|
||||||
PrivacyListWindow(self.account, name, 'EDIT')
|
PrivacyListWindow(self.account, name, 'EDIT')
|
||||||
|
|
||||||
class InvitationReceivedDialog:
|
class InvitationReceivedDialog:
|
||||||
def __init__(self, account, room_jid, contact_jid, password=None,
|
def __init__(self, account, room_jid, contact_fjid, password=None,
|
||||||
comment=None, is_continued=False):
|
comment=None, is_continued=False):
|
||||||
|
|
||||||
self.room_jid = room_jid
|
self.room_jid = room_jid
|
||||||
self.account = account
|
self.account = account
|
||||||
self.password = password
|
self.password = password
|
||||||
self.is_continued = is_continued
|
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''')
|
pritext = _('''You are invited to a groupchat''')
|
||||||
#Don't translate $Contact
|
#Don't translate $Contact
|
||||||
|
@ -4478,8 +4480,8 @@ class InvitationReceivedDialog:
|
||||||
sectext = _('$Contact has invited you to join a discussion')
|
sectext = _('$Contact has invited you to join a discussion')
|
||||||
else:
|
else:
|
||||||
sectext = _('$Contact has invited you to group chat %(room_jid)s')\
|
sectext = _('$Contact has invited you to group chat %(room_jid)s')\
|
||||||
% {'room_jid': room_jid}
|
% {'room_jid': room_jid}
|
||||||
contact = gajim.contacts.get_first_contact_from_jid(account, contact_jid)
|
contact = gajim.contacts.get_first_contact_from_jid(account, jid)
|
||||||
contact_text = contact and contact.name or contact_jid
|
contact_text = contact and contact.name or contact_jid
|
||||||
sectext = sectext.replace('$Contact', contact_text)
|
sectext = sectext.replace('$Contact', contact_text)
|
||||||
|
|
||||||
|
@ -4501,7 +4503,7 @@ class InvitationReceivedDialog:
|
||||||
|
|
||||||
def on_no(text):
|
def on_no(text):
|
||||||
gajim.connections[account].decline_invitation(self.room_jid,
|
gajim.connections[account].decline_invitation(self.room_jid,
|
||||||
self.contact_jid, text)
|
self.contact_fjid, text)
|
||||||
|
|
||||||
YesNoDialog(pritext, sectext, text_label=_('Reason:'),
|
YesNoDialog(pritext, sectext, text_label=_('Reason:'),
|
||||||
on_response_yes=on_yes, on_response_no=on_no)
|
on_response_yes=on_yes, on_response_no=on_no)
|
||||||
|
|
|
@ -628,18 +628,19 @@ class Interface:
|
||||||
jid = gajim.get_jid_without_resource(obj.jid_from)
|
jid = gajim.get_jid_without_resource(obj.jid_from)
|
||||||
account = obj.conn.name
|
account = obj.conn.name
|
||||||
if helpers.allow_popup_window(account) or not self.systray_enabled:
|
if helpers.allow_popup_window(account) or not self.systray_enabled:
|
||||||
dialogs.InvitationReceivedDialog(account, obj.room_jid, jid,
|
dialogs.InvitationReceivedDialog(account, obj.room_jid,
|
||||||
obj.password, obj.reason, is_continued=obj.is_continued)
|
obj.jid_from, obj.password, obj.reason,
|
||||||
|
is_continued=obj.is_continued)
|
||||||
return
|
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))
|
obj.reason, obj.password, obj.is_continued))
|
||||||
|
|
||||||
if helpers.allow_showing_notification(account):
|
if helpers.allow_showing_notification(account):
|
||||||
path = gtkgui_helpers.get_icon_path('gajim-gc_invitation', 48)
|
path = gtkgui_helpers.get_icon_path('gajim-gc_invitation', 48)
|
||||||
event_type = _('Groupchat Invitation')
|
event_type = _('Groupchat Invitation')
|
||||||
notify.popup(event_type, jid, account, 'gc-invitation', path,
|
notify.popup(event_type, obj.jid_from, account, 'gc-invitation',
|
||||||
event_type, obj.room_jid)
|
path, event_type, obj.room_jid)
|
||||||
|
|
||||||
def forget_gpg_passphrase(self, keyid):
|
def forget_gpg_passphrase(self, keyid):
|
||||||
if keyid in self.gpg_passphrase:
|
if keyid in self.gpg_passphrase:
|
||||||
|
|
Loading…
Add table
Reference in a new issue