summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2017-05-15 22:41:18 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2017-05-15 22:41:18 +0100
commita3dfd55e049d289ff8086878eadcea4f8e258502 (patch)
tree5abbedcb42aa6967e546f8b8f49d75c1faf575f6
parentcc4132e0b4ba8ce8ad7ccaac5ed0a45146020563 (diff)
downloadpoezio-a3dfd55e049d289ff8086878eadcea4f8e258502.tar.gz
poezio-a3dfd55e049d289ff8086878eadcea4f8e258502.tar.bz2
poezio-a3dfd55e049d289ff8086878eadcea4f8e258502.tar.xz
poezio-a3dfd55e049d289ff8086878eadcea4f8e258502.zip
Merge /unquery and /close into OneToOneTab.
-rw-r--r--poezio/tabs/basetabs.py11
-rw-r--r--poezio/tabs/conversationtab.py8
-rw-r--r--poezio/tabs/privatetab.py11
3 files changed, 11 insertions, 19 deletions
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py
index 2f6be22b..f4c4cf0a 100644
--- a/poezio/tabs/basetabs.py
+++ b/poezio/tabs/basetabs.py
@@ -709,6 +709,10 @@ class OneToOneTab(ChatTab):
self.remote_supports_attention = True
self.remote_supports_receipts = True
self.check_features()
+ self.register_command('unquery', self.command_unquery,
+ shortdesc='Close the tab.')
+ self.register_command('close', self.command_unquery,
+ shortdesc='Close the tab.')
def remote_user_color(self):
return dump_tuple(get_theme().COLOR_REMOTE_USER)
@@ -816,6 +820,13 @@ class OneToOneTab(ChatTab):
def command_say(self, line, correct=False, attention=False):
pass
+ @command_args_parser.ignored
+ def command_unquery(self):
+ """
+ /unquery
+ """
+ self.core.close_tab(self)
+
def missing_command_callback(self, command_name):
if command_name not in ('correct', 'attention'):
return False
diff --git a/poezio/tabs/conversationtab.py b/poezio/tabs/conversationtab.py
index 461d8fae..5c309672 100644
--- a/poezio/tabs/conversationtab.py
+++ b/poezio/tabs/conversationtab.py
@@ -51,10 +51,6 @@ class ConversationTab(OneToOneTab):
# keys
self.key_func['^I'] = self.completion
# commands
- self.register_command('unquery', self.command_unquery,
- shortdesc='Close the tab.')
- self.register_command('close', self.command_unquery,
- shortdesc='Close the tab.')
self.register_command('version', self.command_version,
desc='Get the software version of the current interlocutor (usually its XMPP client and Operating System).',
shortdesc='Get the software version of the user.')
@@ -205,10 +201,6 @@ class ConversationTab(OneToOneTab):
self._text_buffer.add_message("\x19%(info_col)s}No information available\x19o" % {'info_col': dump_tuple(get_theme().COLOR_INFORMATION_TEXT)})
return True
- @command_args_parser.ignored
- def command_unquery(self):
- self.core.close_tab(self)
-
@command_args_parser.quoted(0, 1)
def command_version(self, args):
"""
diff --git a/poezio/tabs/privatetab.py b/poezio/tabs/privatetab.py
index b6c19f1a..9279929a 100644
--- a/poezio/tabs/privatetab.py
+++ b/poezio/tabs/privatetab.py
@@ -49,10 +49,6 @@ class PrivateTab(OneToOneTab):
self.register_command('info', self.command_info,
desc='Display some information about the user in the MUC: its/his/her role, affiliation, status and status message.',
shortdesc='Info about the user.')
- self.register_command('unquery', self.command_unquery,
- shortdesc='Close the tab.')
- self.register_command('close', self.command_unquery,
- shortdesc='Close the tab.')
self.register_command('version', self.command_version,
desc='Get the software version of the current interlocutor (usually its XMPP client and Operating System).',
shortdesc='Get the software version of a jid.')
@@ -190,13 +186,6 @@ class PrivateTab(OneToOneTab):
self.text_win.refresh()
self.input.refresh()
- @command_args_parser.ignored
- def command_unquery(self):
- """
- /unquery
- """
- self.core.close_tab(self)
-
@command_args_parser.quoted(0, 1)
def command_version(self, args):
"""