summaryrefslogtreecommitdiff
path: root/src/tabs/privatetab.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-03-24 23:25:06 +0100
committermathieui <mathieui@mathieui.net>2014-03-24 23:25:06 +0100
commit8d4202501d68e165ef85f720e72cb83ce384eab8 (patch)
tree7145f62740f7e3176bd845a103e012d4effe4cc7 /src/tabs/privatetab.py
parent6b1e3dd4ac03b14a4af23cf3e0060f4c3d1de328 (diff)
downloadpoezio-8d4202501d68e165ef85f720e72cb83ce384eab8.tar.gz
poezio-8d4202501d68e165ef85f720e72cb83ce384eab8.tar.bz2
poezio-8d4202501d68e165ef85f720e72cb83ce384eab8.tar.xz
poezio-8d4202501d68e165ef85f720e72cb83ce384eab8.zip
Use RawConfigParser.get{int,bool,float} whenever possible
config.get('option', 'value').lower() == 'value' is just ugly and stupid, especially for bool. One if in basetabs:556 was also missing a comparison, leading to True whenever the option was set.
Diffstat (limited to 'src/tabs/privatetab.py')
-rw-r--r--src/tabs/privatetab.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tabs/privatetab.py b/src/tabs/privatetab.py
index 6adbf878..b1c11ae2 100644
--- a/src/tabs/privatetab.py
+++ b/src/tabs/privatetab.py
@@ -138,7 +138,7 @@ class PrivateTab(ChatTab):
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.get_name()).lower() != 'false':
+ if config.get_by_tabname('group_corrections', True, self.get_name()):
try:
self.modify_message(msg['body'], self.last_sent_message['id'], msg['id'],
user=user, jid=self.core.xmpp.boundjid, nickname=self.own_nick)
@@ -152,7 +152,7 @@ class PrivateTab(ChatTab):
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) == 'true' and self.remote_wants_chatstates is not False:
+ if config.get_by_tabname('send_chat_states', True, self.general_jid, True) 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:
@@ -285,8 +285,8 @@ class PrivateTab(ChatTab):
self.text_win.add_line_separator(self._text_buffer)
tab = self.core.get_tab_by_name(safeJID(self.name).bare, MucTab)
if tab and tab.joined and config.get_by_tabname(
- 'send_chat_states', 'true', self.general_jid, True) == 'true'\
- and not self.input.get_text() and self.on:
+ 'send_chat_states', True, self.general_jid, True) and\
+ not self.input.get_text() and self.on:
self.send_chat_state('inactive')
self.check_scrolled()
@@ -295,8 +295,8 @@ class PrivateTab(ChatTab):
curses.curs_set(1)
tab = self.core.get_tab_by_name(safeJID(self.name).bare, MucTab)
if tab and tab.joined and config.get_by_tabname(
- 'send_chat_states', 'true', self.general_jid, True) == 'true'\
- and not self.input.get_text() and self.on:
+ 'send_chat_states', True, self.general_jid, True) and\
+ not self.input.get_text() and self.on:
self.send_chat_state('active')
def on_info_win_size_changed(self):