fix a tb
This commit is contained in:
		
							parent
							
								
									7671dae8b8
								
							
						
					
					
						commit
						83ffab141f
					
				
					 2 changed files with 10 additions and 8 deletions
				
			
		
							
								
								
									
										11
									
								
								src/gajim.py
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								src/gajim.py
									
										
									
									
									
								
							| 
						 | 
					@ -627,14 +627,15 @@ class Interface:
 | 
				
			||||||
	def handle_event_vcard(self, account, vcard):
 | 
						def handle_event_vcard(self, account, vcard):
 | 
				
			||||||
		'''vcard holds the vcard data'''
 | 
							'''vcard holds the vcard data'''
 | 
				
			||||||
		jid = vcard['jid']
 | 
							jid = vcard['jid']
 | 
				
			||||||
 | 
							resource = vcard['resource']
 | 
				
			||||||
		self.store_avatar(vcard)
 | 
							self.store_avatar(vcard)
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		# vcard window
 | 
							# vcard window
 | 
				
			||||||
		win = None
 | 
							win = None
 | 
				
			||||||
		if self.windows[account]['infos'].has_key(jid):
 | 
							if self.windows[account]['infos'].has_key(jid):
 | 
				
			||||||
			win = self.windows[account]['infos'][jid]
 | 
								win = self.windows[account]['infos'][jid]
 | 
				
			||||||
		elif self.windows[account]['infos'].has_key(jid + '/' +vcard['resource']):
 | 
							elif self.windows[account]['infos'].has_key(jid + '/' + resource):
 | 
				
			||||||
			win = self.windows[account]['infos'][jid + '/' + vcard['resource']]
 | 
								win = self.windows[account]['infos'][jid + '/' + resource]
 | 
				
			||||||
		if win:
 | 
							if win:
 | 
				
			||||||
			win.set_values(vcard) #FIXME: maybe store all vcard data?
 | 
								win.set_values(vcard) #FIXME: maybe store all vcard data?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -642,10 +643,10 @@ class Interface:
 | 
				
			||||||
		win = None
 | 
							win = None
 | 
				
			||||||
		if self.windows[account]['chats'].has_key(jid):
 | 
							if self.windows[account]['chats'].has_key(jid):
 | 
				
			||||||
			win = self.windows[account]['chats'][jid]
 | 
								win = self.windows[account]['chats'][jid]
 | 
				
			||||||
		elif self.windows[account]['chats'].has_key(jid + '/' +vcard['resource']):
 | 
							elif self.windows[account]['chats'].has_key(jid + '/' + resource):
 | 
				
			||||||
			win = self.windows[account]['chats'][jid + '/' + vcard['resource']]
 | 
								win = self.windows[account]['chats'][jid + '/' + resource]
 | 
				
			||||||
		if win:
 | 
							if win:
 | 
				
			||||||
			win.show_avatar(jid)
 | 
								win.show_avatar(jid, resource)
 | 
				
			||||||
		if self.remote is not None:
 | 
							if self.remote is not None:
 | 
				
			||||||
			self.remote.raise_signal('VcardInfo', (account, vcard))
 | 
								self.remote.raise_signal('VcardInfo', (account, vcard))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -222,7 +222,7 @@ timestamp, contact):
 | 
				
			||||||
	def get_specific_unread(self, jid):
 | 
						def get_specific_unread(self, jid):
 | 
				
			||||||
		return 0 # FIXME: always zero why??
 | 
							return 0 # FIXME: always zero why??
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def show_avatar(self, jid):
 | 
						def show_avatar(self, jid, resource):
 | 
				
			||||||
		if self.plugin.avatar_pixbufs[jid] is None:
 | 
							if self.plugin.avatar_pixbufs[jid] is None:
 | 
				
			||||||
			return # contact has no avatar
 | 
								return # contact has no avatar
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -236,7 +236,7 @@ timestamp, contact):
 | 
				
			||||||
			x = self.xmls[jid]
 | 
								x = self.xmls[jid]
 | 
				
			||||||
		else:
 | 
							else:
 | 
				
			||||||
			# it can be xmls[jid/resource] if it's a vcard from pm
 | 
								# it can be xmls[jid/resource] if it's a vcard from pm
 | 
				
			||||||
			jid_with_resource = jid + '/' + vcard['resource']
 | 
								jid_with_resource = jid + '/' + resource
 | 
				
			||||||
			if self.xmls.has_key(jid_with_resource):
 | 
								if self.xmls.has_key(jid_with_resource):
 | 
				
			||||||
				x = self.xmls[jid_with_resource]
 | 
									x = self.xmls[jid_with_resource]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -388,7 +388,8 @@ timestamp, contact):
 | 
				
			||||||
			#avatars in roster
 | 
								#avatars in roster
 | 
				
			||||||
			#print 'REQUESTING VCARD for', contact.jid
 | 
								#print 'REQUESTING VCARD for', contact.jid
 | 
				
			||||||
		else:
 | 
							else:
 | 
				
			||||||
			self.show_avatar(contact.jid) # show avatar from stored place
 | 
								# show avatar from stored place
 | 
				
			||||||
 | 
								self.show_avatar(contact.jid, contact.resource)
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		self.childs[contact.jid].connect('drag_data_received',
 | 
							self.childs[contact.jid].connect('drag_data_received',
 | 
				
			||||||
			self.on_drag_data_received, contact)
 | 
								self.on_drag_data_received, contact)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue