Skip to content
Snippets Groups Projects
Commit da1226df authored by nkour's avatar nkour
Browse files

gain in readability and speed [extra care as we call this method every time we print a msg]

parent d5842b8e
No related branches found
No related tags found
No related merge requests found
......@@ -562,9 +562,9 @@ def print_conversation_line(self, text, jid, kind, name, tim,
before_str = gajim.config.get('before_time')
after_str = gajim.config.get('after_time')
# get difference in days since epoch (86400 = 24*3600)
no_of_days_since_epoch = int(timegm(time.localtime())) / 86400 # for GMT time
no_of_days_since_epoch_for_msg = int(timegm(tim)) / 86400 # for GMT time
diff_day = no_of_days_since_epoch - no_of_days_since_epoch_for_msg
# number of days since epoch for current time (in GMT) -
# number of days since epoch for message (in GMT)
diff_day = int(timegm(time.localtime())) / 86400 - int(timegm(tim)) / 86400
if diff_day == 0:
day_str = ''
elif diff_day == 1:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment