From c9d27e163ecdab8cedee6c43ae09799da77c97c1 Mon Sep 17 00:00:00 2001
From: Jean-Marie Traissard <jim@lapin.org>
Date: Tue, 26 Sep 2006 17:44:29 +0000
Subject: [PATCH] Do not show seconds in roster tooltips (if today) Better
 description of option print_fuzzy

---
 src/common/config.py | 2 +-
 src/tooltips.py      | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/common/config.py b/src/common/config.py
index ddd9b58222..d8c403aa16 100644
--- a/src/common/config.py
+++ b/src/common/config.py
@@ -84,7 +84,7 @@ class Config:
 		'use_speller': [ opt_bool, False, ],
 		'speller_language': [ opt_str, '', _('Language used by speller')],
 		'print_time': [ opt_str, 'always',  _('\'always\' - print time for every message.\n\'sometimes\' - print time every print_ichat_every_foo_minutes minute.\n\'never\' - never print time.')],
-		'print_time_fuzzy': [ opt_int, 0, _('Value of fuzziness from 1 to 4 or 0 to disable fuzzyclock. 1 is the most precise clock, 4 the less precise one.') ],
+		'print_time_fuzzy': [ opt_int, 0, _('Print time in chats using Fuzzy Clock. Value of fuzziness from 1 to 4, or 0 to disable fuzzyclock. 1 is the most precise clock, 4 the less precise one. This is used only if print_time is \'sometimes\'.') ],
 		'emoticons_theme': [opt_str, 'static', '', True ],
 		'ascii_formatting': [ opt_bool, True,
 			_('Treat * / _ pairs as possible formatting characters.'), True],
diff --git a/src/tooltips.py b/src/tooltips.py
index 008d0b76aa..53df7e124d 100644
--- a/src/tooltips.py
+++ b/src/tooltips.py
@@ -529,7 +529,12 @@ class RosterTooltip(NotificationAreaTooltip):
 					if time.strftime('%j', time.localtime())== \
 							time.strftime('%j', contact.last_status_time):
 					# it's today, show only the locale hour representation
-						local_time = time.strftime('%X', contact.last_status_time)	
+						local_time = time.strftime('%X', contact.last_status_time)
+						# Hack to delete seconds 
+						# We can't use hour:minutes directly because we don't
+						# know if we should use %H or %I (depend of user locale) 
+						# See http://docs.python.org/lib/module-time.html
+						local_time = local_time[:-3]
 					else:
 						# time.strftime returns locale encoded string
 						local_time = time.strftime('%c', contact.last_status_time)
-- 
GitLab