prevent from having more than one captcha in groupchat
This commit is contained in:
parent
6c5565bfe2
commit
e169dc6367
1 changed files with 7 additions and 1 deletions
|
@ -389,6 +389,8 @@ class GroupchatControl(ChatControlBase):
|
||||||
|
|
||||||
self.setup_seclabel(self.xml.get_object('label_selector'))
|
self.setup_seclabel(self.xml.get_object('label_selector'))
|
||||||
|
|
||||||
|
self.form_widget = None
|
||||||
|
|
||||||
gajim.gc_connected[self.account][self.room_jid] = False
|
gajim.gc_connected[self.account][self.room_jid] = False
|
||||||
# disable win, we are not connected yet
|
# disable win, we are not connected yet
|
||||||
ChatControlBase.got_disconnected(self)
|
ChatControlBase.got_disconnected(self)
|
||||||
|
@ -791,6 +793,10 @@ class GroupchatControl(ChatControlBase):
|
||||||
def on_message(self, nick, msg, tim, has_timestamp=False, xhtml=None,
|
def on_message(self, nick, msg, tim, has_timestamp=False, xhtml=None,
|
||||||
status_code=[], displaymarking=None, captcha=None):
|
status_code=[], displaymarking=None, captcha=None):
|
||||||
if captcha:
|
if captcha:
|
||||||
|
if self.form_widget:
|
||||||
|
self.form_widget.hide()
|
||||||
|
self.form_widget.destroy()
|
||||||
|
self.btn_box.destroy()
|
||||||
dataform = dataforms.ExtendForm(node=captcha)
|
dataform = dataforms.ExtendForm(node=captcha)
|
||||||
self.form_widget = dataforms_widget.DataFormWidget(dataform)
|
self.form_widget = dataforms_widget.DataFormWidget(dataform)
|
||||||
self.form_widget.show_all()
|
self.form_widget.show_all()
|
||||||
|
@ -807,7 +813,7 @@ class GroupchatControl(ChatControlBase):
|
||||||
self.form_widget.hide()
|
self.form_widget.hide()
|
||||||
self.form_widget.destroy()
|
self.form_widget.destroy()
|
||||||
self.btn_box.destroy()
|
self.btn_box.destroy()
|
||||||
del self.form_widget
|
self.form_widget = None
|
||||||
del self.btn_box
|
del self.btn_box
|
||||||
|
|
||||||
valid_button = gtk.Button(stock=gtk.STOCK_OK)
|
valid_button = gtk.Button(stock=gtk.STOCK_OK)
|
||||||
|
|
Loading…
Add table
Reference in a new issue