Send cancel IQ if muc configuration is aborted

Fixes #9069
This commit is contained in:
Philipp Hörist 2018-06-23 23:32:14 +02:00
parent a30a61e5ff
commit fd137be30f
2 changed files with 15 additions and 1 deletions

View File

@ -2720,6 +2720,17 @@ class Connection(CommonConnection, ConnectionHandlers):
self.add_lang(iq)
self.connection.send(iq)
def cancel_gc_config(self, room_jid):
if not app.account_is_connected(self.name):
return
cancel = nbxmpp.Node(tag='x', attrs={'xmlns': nbxmpp.NS_DATA,
'type': 'cancel'})
iq = nbxmpp.Iq(typ='set',
queryNS=nbxmpp.NS_MUC_OWNER,
payload=cancel,
to=room_jid)
self.connection.send(iq)
def destroy_gc_room(self, room_jid, reason = '', jid = ''):
if not app.account_is_connected(self.name):
return

View File

@ -1642,9 +1642,12 @@ class GroupchatConfigWindow:
affiliation)
self.xml.connect_signals(self)
self.window.connect('delete-event', self.on_cancel_button_clicked)
self.window.show_all()
def on_cancel_button_clicked(self, widget):
def on_cancel_button_clicked(self, *args):
if self.form:
app.connections[self.account].cancel_gc_config(self.room_jid)
self.window.destroy()
def on_cell_edited(self, cell, path, new_text):