Use open JoinGroupchat Dialog when browsing MUCs

This commit is contained in:
Philipp Hörist 2018-07-06 21:43:53 +02:00
parent d45fa13ee9
commit 63a27ace61
2 changed files with 8 additions and 4 deletions

View File

@ -583,6 +583,9 @@ def prefers_app_menu():
def get_app_window(cls):
for win in app.get_windows():
if isinstance(win, cls):
if isinstance(cls, str):
if type(win).__name__ == cls:
return win
elif isinstance(win, cls):
return win
return None

View File

@ -1797,11 +1797,12 @@ class MucBrowser(AgentBrowser):
if not iter_:
return
service = model[iter_][0]
if 'join_gc' not in app.interface.instances[self.account]:
window = app.get_app_window('JoinGroupchatWindow')
if window is None:
app.interface.join_gc_minimal(self.account, service)
else:
app.interface.instances[self.account]['join_gc'].set_room(service)
app.interface.instances[self.account]['join_gc'].present()
window.set_room(service)
window.present()
self.window.destroy()
def update_actions(self):