Commit 86005f2b authored by Daniel Brötzmann's avatar Daniel Brötzmann

ServiceDiscovery: Fix window.destroy

parent 1165bde2
Pipeline #3869 passed with stages
in 3 minutes and 28 seconds
...@@ -342,8 +342,9 @@ class ServicesCache: ...@@ -342,8 +342,9 @@ class ServicesCache:
# Some services list it in features and respond to # Some services list it in features and respond to
# NS_DISCO_ITEMS anyways. # NS_DISCO_ITEMS anyways.
# Allow browsing for unknown types as well. # Allow browsing for unknown types as well.
if (not features and not identities) or \ if ((not features and not identities) or
nbxmpp.NS_DISCO_ITEMS in features or nbxmpp.NS_BROWSE in features: nbxmpp.NS_DISCO_ITEMS in features or
nbxmpp.NS_BROWSE in features):
return ToplevelAgentBrowser return ToplevelAgentBrowser
return None return None
...@@ -1038,7 +1039,7 @@ class AgentBrowser: ...@@ -1038,7 +1039,7 @@ class AgentBrowser:
if not items: if not items:
if not self.window.address_comboboxtext: if not self.window.address_comboboxtext:
# We can't travel anywhere else. # We can't travel anywhere else.
self.window.destroy() self.window.window.destroy()
ErrorDialog(_('The service is not browsable'), ErrorDialog(_('The service is not browsable'),
_('This service does not contain any items ' _('This service does not contain any items '
'to browse.'), 'to browse.'),
...@@ -1405,8 +1406,8 @@ class ToplevelAgentBrowser(AgentBrowser): ...@@ -1405,8 +1406,8 @@ class ToplevelAgentBrowser(AgentBrowser):
if self.search_button and nbxmpp.NS_SEARCH in features: if self.search_button and nbxmpp.NS_SEARCH in features:
self.search_button.set_sensitive(True) self.search_button.set_sensitive(True)
# Don't authorize to register with a server via disco # Don't authorize to register with a server via disco
if self.register_button and nbxmpp.NS_REGISTER in features and \ if (self.register_button and nbxmpp.NS_REGISTER in features and
jid != self.jid: jid != self.jid):
# We can register this agent # We can register this agent
registered_transports = [] registered_transports = []
jid_list = app.contacts.get_jid_list(self.account) jid_list = app.contacts.get_jid_list(self.account)
...@@ -1766,7 +1767,7 @@ class MucBrowser(AgentBrowser): ...@@ -1766,7 +1767,7 @@ class MucBrowser(AgentBrowser):
else: else:
window.set_room(service) window.set_room(service)
window.present() window.present()
self.window.destroy() self.window.window.destroy()
def update_actions(self): def update_actions(self):
sens = \ sens = \
...@@ -1862,8 +1863,8 @@ class MucBrowser(AgentBrowser): ...@@ -1862,8 +1863,8 @@ class MucBrowser(AgentBrowser):
name = identities[0].name or '' name = identities[0].name or ''
for form in data: for form in data:
typefield = form.vars.get('FORM_TYPE') typefield = form.vars.get('FORM_TYPE')
if typefield and typefield.value == \ if (typefield and typefield.value ==
'http://jabber.org/protocol/muc#roominfo': 'http://jabber.org/protocol/muc#roominfo'):
# Fill model row from the form's fields # Fill model row from the form's fields
users = form.vars.get('muc#roominfo_occupants') users = form.vars.get('muc#roominfo_occupants')
descr = form.vars.get('muc#roominfo_description') descr = form.vars.get('muc#roominfo_description')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment