summaryrefslogtreecommitdiff
path: root/poezio/tabs
diff options
context:
space:
mode:
Diffstat (limited to 'poezio/tabs')
-rw-r--r--poezio/tabs/basetabs.py11
-rw-r--r--poezio/tabs/xmltab.py5
2 files changed, 8 insertions, 8 deletions
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py
index 40868e2f..eadc9a3f 100644
--- a/poezio/tabs/basetabs.py
+++ b/poezio/tabs/basetabs.py
@@ -45,7 +45,8 @@ from poezio.decorators import command_args_parser, refresh_wrapper
from poezio.logger import logger
from poezio.text_buffer import TextBuffer
from poezio.theming import get_theme, dump_tuple
-from poezio.windows.funcs import truncate_nick
+from poezio.ui.funcs import truncate_nick
+from poezio.ui.consts import LONG_FORMAT_LENGTH
from slixmpp import JID, InvalidJID, Message
@@ -839,12 +840,8 @@ class ChatTab(Tab):
if message.me:
offset += 1
if timestamp:
- if message.str_time:
- offset += 1 + len(message.str_time)
- if theme.CHAR_TIME_LEFT and message.str_time:
- offset += 1
- if theme.CHAR_TIME_RIGHT and message.str_time:
- offset += 1
+ if message.history:
+ offset += 1 + LONG_FORMAT_LENGTH
lines = poopt.cut_text(txt, self.text_win.width - offset - 1)
for line in lines:
built_lines.append(line)
diff --git a/poezio/tabs/xmltab.py b/poezio/tabs/xmltab.py
index c4a50df8..c73eddd0 100644
--- a/poezio/tabs/xmltab.py
+++ b/poezio/tabs/xmltab.py
@@ -262,7 +262,10 @@ class XMLTab(Tab):
else:
xml = self.core_buffer.messages[:]
text = '\n'.join(
- ('%s %s %s' % (msg.str_time, msg.nickname, clean_text(msg.txt))
+ ('%s %s %s' % (
+ msg.time.strftime('%H:%M:%S'),
+ msg.nickname,
+ clean_text(msg.txt))
for msg in xml))
filename = os.path.expandvars(os.path.expanduser(args[0]))
try: