last_time_printout goes into conversation_textview class
This commit is contained in:
		
							parent
							
								
									1142cc1e7d
								
							
						
					
					
						commit
						b94f13a0eb
					
				
					 2 changed files with 3 additions and 5 deletions
				
			
		| 
						 | 
					@ -57,7 +57,6 @@ class Chat:
 | 
				
			||||||
		self.xmls = {}
 | 
							self.xmls = {}
 | 
				
			||||||
		self.conversation_textviews = {}
 | 
							self.conversation_textviews = {}
 | 
				
			||||||
		self.nb_unread = {}
 | 
							self.nb_unread = {}
 | 
				
			||||||
		self.last_time_printout = {}
 | 
					 | 
				
			||||||
		self.print_time_timeout_id = {}
 | 
							self.print_time_timeout_id = {}
 | 
				
			||||||
		self.names = {} # what is printed in the tab (eg. contact.name)
 | 
							self.names = {} # what is printed in the tab (eg. contact.name)
 | 
				
			||||||
		self.childs = {} # holds the contents for every tab (VBox)
 | 
							self.childs = {} # holds the contents for every tab (VBox)
 | 
				
			||||||
| 
						 | 
					@ -528,7 +527,6 @@ class Chat:
 | 
				
			||||||
			del gajim.interface.windows[self.account][kind][jid]
 | 
								del gajim.interface.windows[self.account][kind][jid]
 | 
				
			||||||
		del self.nb_unread[jid]
 | 
							del self.nb_unread[jid]
 | 
				
			||||||
		del gajim.last_message_time[self.account][jid]
 | 
							del gajim.last_message_time[self.account][jid]
 | 
				
			||||||
		del self.last_time_printout[jid]
 | 
					 | 
				
			||||||
		del self.xmls[jid]
 | 
							del self.xmls[jid]
 | 
				
			||||||
		del self.childs[jid]
 | 
							del self.childs[jid]
 | 
				
			||||||
		del self.sent_history[jid]
 | 
							del self.sent_history[jid]
 | 
				
			||||||
| 
						 | 
					@ -620,7 +618,6 @@ class Chat:
 | 
				
			||||||
		self.set_compact_view(self.always_compact_view)
 | 
							self.set_compact_view(self.always_compact_view)
 | 
				
			||||||
		self.nb_unread[jid] = 0
 | 
							self.nb_unread[jid] = 0
 | 
				
			||||||
		gajim.last_message_time[self.account][jid] = 0
 | 
							gajim.last_message_time[self.account][jid] = 0
 | 
				
			||||||
		self.last_time_printout[jid] = 0.
 | 
					 | 
				
			||||||
		font = pango.FontDescription(gajim.config.get('conversation_font'))
 | 
							font = pango.FontDescription(gajim.config.get('conversation_font'))
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		if gajim.config.get('use_speller') and 'gtkspell' in globals():
 | 
							if gajim.config.get('use_speller') and 'gtkspell' in globals():
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -47,6 +47,7 @@ class ConversationTextview(gtk.TextView):
 | 
				
			||||||
		gtk.TextView.__init__(self)
 | 
							gtk.TextView.__init__(self)
 | 
				
			||||||
		self.account = account
 | 
							self.account = account
 | 
				
			||||||
		self.change_cursor = None
 | 
							self.change_cursor = None
 | 
				
			||||||
 | 
							self.last_time_printout = 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		font = pango.FontDescription(gajim.config.get('conversation_font'))
 | 
							font = pango.FontDescription(gajim.config.get('conversation_font'))
 | 
				
			||||||
		self.modify_font(font)
 | 
							self.modify_font(font)
 | 
				
			||||||
| 
						 | 
					@ -528,9 +529,9 @@ class ConversationTextview(gtk.TextView):
 | 
				
			||||||
		elif gajim.config.get('print_time') == 'sometimes':
 | 
							elif gajim.config.get('print_time') == 'sometimes':
 | 
				
			||||||
			every_foo_seconds = 60 * gajim.config.get(
 | 
								every_foo_seconds = 60 * gajim.config.get(
 | 
				
			||||||
				'print_ichat_every_foo_minutes')
 | 
									'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:
 | 
								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()
 | 
									end_iter = buffer.get_end_iter()
 | 
				
			||||||
				tim = time.localtime()
 | 
									tim = time.localtime()
 | 
				
			||||||
				tim_format = time.strftime('%H:%M', tim)
 | 
									tim_format = time.strftime('%H:%M', tim)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue