last_time_printout goes into conversation_textview class

This commit is contained in:
Yann Leboulanger 2005-10-29 08:44:41 +00:00
parent 1142cc1e7d
commit b94f13a0eb
2 changed files with 3 additions and 5 deletions

View File

@ -57,7 +57,6 @@ class Chat:
self.xmls = {}
self.conversation_textviews = {}
self.nb_unread = {}
self.last_time_printout = {}
self.print_time_timeout_id = {}
self.names = {} # what is printed in the tab (eg. contact.name)
self.childs = {} # holds the contents for every tab (VBox)
@ -528,7 +527,6 @@ class Chat:
del gajim.interface.windows[self.account][kind][jid]
del self.nb_unread[jid]
del gajim.last_message_time[self.account][jid]
del self.last_time_printout[jid]
del self.xmls[jid]
del self.childs[jid]
del self.sent_history[jid]
@ -620,7 +618,6 @@ class Chat:
self.set_compact_view(self.always_compact_view)
self.nb_unread[jid] = 0
gajim.last_message_time[self.account][jid] = 0
self.last_time_printout[jid] = 0.
font = pango.FontDescription(gajim.config.get('conversation_font'))
if gajim.config.get('use_speller') and 'gtkspell' in globals():

View File

@ -47,6 +47,7 @@ class ConversationTextview(gtk.TextView):
gtk.TextView.__init__(self)
self.account = account
self.change_cursor = None
self.last_time_printout = 0
font = pango.FontDescription(gajim.config.get('conversation_font'))
self.modify_font(font)
@ -528,9 +529,9 @@ class ConversationTextview(gtk.TextView):
elif gajim.config.get('print_time') == 'sometimes':
every_foo_seconds = 60 * gajim.config.get(
'print_ichat_every_foo_minutes')
seconds_passed = time.time() - self.last_time_printout[jid]
seconds_passed = time.time() - self.last_time_printout
if seconds_passed > every_foo_seconds:
self.last_time_printout[jid] = time.time()
self.last_time_printout = time.time()
end_iter = buffer.get_end_iter()
tim = time.localtime()
tim_format = time.strftime('%H:%M', tim)