Commit 8a58f79f authored by Yann Leboulanger's avatar Yann Leboulanger

improve pasting xmpp uri in join groupchat dialogs. Fixes #7905

parent 7b7da231
......@@ -2513,11 +2513,16 @@ class JoinGroupchatWindow:
if not self._empty_required_widgets and self.account:
self.xml.get_object('join_button').set_sensitive(True)
text = self._room_jid_entry.get_text()
if widget == self._room_jid_entry and text.startswith('xmpp:'):
text = text[5:]
self._room_jid_entry.set_text(text)
if widget == self._room_jid_entry and '@' in text:
# Don't allow @ char in room entry
room_jid, server = text.split('@', 1)
self._room_jid_entry.set_text(room_jid)
if server:
if '?' in server:
server = server.split('?')[0]
self.server_comboboxentry.child.set_text(server)
self.server_comboboxentry.grab_focus()
......
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