summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhur Garg <madhurgarg96@gmail.com>2019-03-22 17:15:02 +0530
committerMaxime “pep” Buquet <pep@bouah.net>2019-03-23 16:04:36 +0000
commit53ededcb19fd0384e96dbe7677ced2faf0de500a (patch)
tree4c97b3fb74f823a554a9ab1645fa9cfe63f2019b
parent86ee25491cbfc88a0d63cc9e26621fe86f8a4196 (diff)
downloadpoezio-53ededcb19fd0384e96dbe7677ced2faf0de500a.tar.gz
poezio-53ededcb19fd0384e96dbe7677ced2faf0de500a.tar.bz2
poezio-53ededcb19fd0384e96dbe7677ced2faf0de500a.tar.xz
poezio-53ededcb19fd0384e96dbe7677ced2faf0de500a.zip
Corrects functionality of /reconnect in all type of tabs. Fixes #3471
Corrects functionality of /reconnect in all type of tabs. Fixes #3471 Moved command_reconnect from particular tabs to core.commands. Fixes #3471
-rw-r--r--poezio/core/commands.py10
-rw-r--r--poezio/core/core.py7
-rw-r--r--poezio/tabs/rostertab.py17
3 files changed, 17 insertions, 17 deletions
diff --git a/poezio/core/commands.py b/poezio/core/commands.py
index b3ebb811..4dbb5611 100644
--- a/poezio/core/commands.py
+++ b/poezio/core/commands.py
@@ -509,6 +509,16 @@ class CommandCore:
else:
self.core.information('No bookmark to remove', 'Info')
+ @command_args_parser.ignored
+ def command_reconnect(self):
+ """
+ /reconnect
+ """
+ if self.core.xmpp.is_connected():
+ self.core.disconnect(reconnect=True)
+ else:
+ self.core.xmpp.connect()
+
@command_args_parser.quoted(0, 3)
def set(self, args):
"""
diff --git a/poezio/core/core.py b/poezio/core/core.py
index 79b5d56f..6bb19d16 100644
--- a/poezio/core/core.py
+++ b/poezio/core/core.py
@@ -1759,6 +1759,13 @@ class Core:
shortdesc="Bookmark a room online.",
completion=self.completion.bookmark)
self.register_command(
+ 'reconnect',
+ self.command.command_reconnect,
+ usage="[reconnect]",
+ desc='Disconnect from the remote server if you are '
+ 'currently connected and then connect to it again.',
+ shortdesc='Disconnect and reconnect to the server.')
+ self.register_command(
'set',
self.command.set,
usage="[plugin|][section] <option> [value]",
diff --git a/poezio/tabs/rostertab.py b/poezio/tabs/rostertab.py
index 6e73051e..7c941aa9 100644
--- a/poezio/tabs/rostertab.py
+++ b/poezio/tabs/rostertab.py
@@ -165,13 +165,6 @@ class RosterInfoTab(Tab):
self.command_password,
usage='<password>',
shortdesc='Change your password')
-
- self.register_command(
- 'reconnect',
- self.command_reconnect,
- desc='Disconnect from the remote server if you are '
- 'currently connected and then connect to it again.',
- shortdesc='Disconnect and reconnect to the server.')
self.register_command(
'disconnect',
self.command_disconnect,
@@ -533,16 +526,6 @@ class RosterInfoTab(Tab):
self.core.xmpp.plugin['xep_0191'].get_blocked(callback=callback)
@command_args_parser.ignored
- def command_reconnect(self):
- """
- /reconnect
- """
- if self.core.xmpp.is_connected():
- self.core.disconnect(reconnect=True)
- else:
- self.core.xmpp.connect()
-
- @command_args_parser.ignored
def command_disconnect(self):
"""
/disconnect