From 7b01c62e07612a123f3ffe94583f51099e470c3b Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 20 Oct 2014 20:03:16 +0200 Subject: Change the API of Config.get_by_tabname Make the "default" parameter optional and thus move it to the end of the command with the other optional parameters. And change all the calls. --- src/tabs/conversationtab.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/tabs/conversationtab.py') diff --git a/src/tabs/conversationtab.py b/src/tabs/conversationtab.py index 94cfd305..b2d526de 100644 --- a/src/tabs/conversationtab.py +++ b/src/tabs/conversationtab.py @@ -108,7 +108,7 @@ class ConversationTab(OneToOneTab): replaced = False if correct or msg['replace']['id']: msg['replace']['id'] = self.last_sent_message['id'] - if config.get_by_tabname('group_corrections', True, self.name): + if config.get_by_tabname('group_corrections', self.name): try: self.modify_message(msg['body'], self.last_sent_message['id'], msg['id'], jid=self.core.xmpp.boundjid, nickname=self.core.own_nick) @@ -121,7 +121,8 @@ class ConversationTab(OneToOneTab): msg.enable('html') msg['html']['body'] = xhtml.poezio_colors_to_html(msg['body']) msg['body'] = xhtml.clean_text(msg['body']) - if config.get_by_tabname('send_chat_states', True, self.general_jid, True) and self.remote_wants_chatstates is not False: + if (config.get_by_tabname('send_chat_states', self.general_jid) and + self.remote_wants_chatstates is not False): needed = 'inactive' if self.inactive else 'active' msg['chat_state'] = needed if attention and self.remote_supports_attention: @@ -316,7 +317,9 @@ class ConversationTab(OneToOneTab): self.state = 'normal' self.text_win.remove_line_separator() self.text_win.add_line_separator(self._text_buffer) - if config.get_by_tabname('send_chat_states', True, self.general_jid, True) and (not self.input.get_text() or not self.input.get_text().startswith('//')): + if (config.get_by_tabname('send_chat_states', self.general_jid) + and (not self.input.get_text() + or not self.input.get_text().startswith('//'))): if resource: self.send_chat_state('inactive') self.check_scrolled() @@ -334,7 +337,9 @@ class ConversationTab(OneToOneTab): self.state = 'current' curses.curs_set(1) - if config.get_by_tabname('send_chat_states', True, self.general_jid, True) and (not self.input.get_text() or not self.input.get_text().startswith('//')): + if (config.get_by_tabname('send_chat_states', self.general_jid) + and (not self.input.get_text() + or not self.input.get_text().startswith('//'))): if resource: self.send_chat_state('active') @@ -349,7 +354,7 @@ class ConversationTab(OneToOneTab): def on_close(self): Tab.on_close(self) - if config.get_by_tabname('send_chat_states', True, self.general_jid, True): + if config.get_by_tabname('send_chat_states', self.general_jid): self.send_chat_state('gone') def matching_names(self): -- cgit v1.2.3