summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-01-21 19:45:19 +0100
committermathieui <mathieui@mathieui.net>2013-01-21 19:45:19 +0100
commit6a81c021e18365c15703db868a9904eb196c7e03 (patch)
tree331776a85d628c6a45f28d3c0600caaa0379e98f /src
parent43e01ce4a6b7aca0bd26af5b432449afc4817b90 (diff)
downloadpoezio-6a81c021e18365c15703db868a9904eb196c7e03.tar.gz
poezio-6a81c021e18365c15703db868a9904eb196c7e03.tar.bz2
poezio-6a81c021e18365c15703db868a9904eb196c7e03.tar.xz
poezio-6a81c021e18365c15703db868a9904eb196c7e03.zip
Fix it for real.
Diffstat (limited to 'src')
-rw-r--r--src/core.py9
-rw-r--r--src/tabs.py2
2 files changed, 7 insertions, 4 deletions
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:
diff --git a/src/tabs.py b/src/tabs.py
index 4b1a695b..2e39988d 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -789,7 +789,7 @@ class MucTab(ChatTab):
last_message = self._text_buffer.last_message
if last_message:
return last_message.time
- return 0
+ return None
@refresh_wrapper.always
def go_to_next_hl(self):