diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-04-18 03:42:10 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-04-18 03:42:10 +0200 |
commit | 4b932d3a87877031be2cec35f7729473e58bae3d (patch) | |
tree | 95a3656109e7f0e54bf8ae5d0fa32f7c43391bb3 | |
parent | d913e715133756bcab123b2373b25a905707042f (diff) | |
download | poezio-4b932d3a87877031be2cec35f7729473e58bae3d.tar.gz poezio-4b932d3a87877031be2cec35f7729473e58bae3d.tar.bz2 poezio-4b932d3a87877031be2cec35f7729473e58bae3d.tar.xz poezio-4b932d3a87877031be2cec35f7729473e58bae3d.zip |
Do not dispaly information message about the contact that were already connected at the moment we got logged in.
-rw-r--r-- | src/core.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core.py b/src/core.py index 65bd59be..c000fd55 100644 --- a/src/core.py +++ b/src/core.py @@ -16,11 +16,10 @@ from gettext import gettext as _ -from time import sleep - import os import re import sys +import time import curses import threading import traceback @@ -87,6 +86,7 @@ class Core(object): def __init__(self): # All uncaught exception are given to this callback, instead # of being displayed on the screen and exiting the program. + self.connection_time = time.time() self.status = Status(show=None, message='') sys.excepthook = self.on_exception self.running = True @@ -368,7 +368,9 @@ class Core(object): self.add_information_message_to_conversation_tab(jid.full, '\x195%s is \x194online' % (jid.full)) if not contact.get_highest_priority_resource(): # No connected resource yet: the user's just connecting - self.information("\x193%s \x195is \x194online\x195 (\x190%s\x195)" % (resource.get_jid().bare, status), "Roster") + if time.time() - self.connection_time > 12: + # We do not display messages if we recently logged in + self.information("\x193%s \x195is \x194online\x195 (\x190%s\x195)" % (resource.get_jid().bare, status), "Roster") self.add_information_message_to_conversation_tab(jid.bare, '\x195%s is \x194online' % (jid.bare)) contact.add_resource(resource) @@ -412,6 +414,7 @@ class Core(object): """ Called when we are connected and authenticated """ + self.connection_time = time.time() self.information(_("Authentication success.")) self.information(_("Your JID is %s") % self.xmpp.boundjid.full) if not self.xmpp.anon: |