From 6a81c021e18365c15703db868a9904eb196c7e03 Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 21 Jan 2013 19:45:19 +0100 Subject: Fix it for real. --- src/core.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/core.py') diff --git a/src/core.py b/src/core.py index e06007bf..7b536faa 100644 --- a/src/core.py +++ b/src/core.py @@ -1705,9 +1705,12 @@ class Core(object): if password is None: # try to use a saved password password = config.get_by_tabname('password', None, room, fallback=False) if tab and not tab.joined: - delta = datetime.now() - tab.last_connection - seconds = delta.seconds + delta.days * 24 * 3600 if tab.last_connection is not None else 0 - seconds = int(seconds) + if tab.last_connection: + delta = datetime.now() - tab.last_connection + seconds = delta.seconds + delta.days * 24 * 3600 if tab.last_connection is not None else 0 + seconds = int(seconds) + else: + seconds = 0 muc.join_groupchat(self.xmpp, room, nick, password, histo_length, current_status.message, current_status.show, seconds=seconds) if not tab: -- cgit v1.2.3