Never load avatars for roster and gc-roster if we don't want them.
See #3718. See also [9287].
This commit is contained in:
		
							parent
							
								
									dea4d9f745
								
							
						
					
					
						commit
						4d675c42b1
					
				
					 2 changed files with 13 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -943,15 +943,12 @@ class GroupchatControl(ChatControlBase):
 | 
			
		|||
		iter = self.get_contact_iter(nick)
 | 
			
		||||
		if not iter:
 | 
			
		||||
			return
 | 
			
		||||
		if gajim.config.get('show_avatars_in_roster'):
 | 
			
		||||
			pixbuf = gtkgui_helpers.get_avatar_pixbuf_from_cache(self.room_jid + \
 | 
			
		||||
				'/' + nick, True)
 | 
			
		||||
			if pixbuf in ('ask', None):
 | 
			
		||||
				scaled_pixbuf = None
 | 
			
		||||
			else:
 | 
			
		||||
				scaled_pixbuf = gtkgui_helpers.get_scaled_pixbuf(pixbuf, 'roster')
 | 
			
		||||
		else:
 | 
			
		||||
		pixbuf = gtkgui_helpers.get_avatar_pixbuf_from_cache(self.room_jid + \
 | 
			
		||||
			'/' + nick, True)
 | 
			
		||||
		if pixbuf in ('ask', None):
 | 
			
		||||
			scaled_pixbuf = None
 | 
			
		||||
		else:
 | 
			
		||||
			scaled_pixbuf = gtkgui_helpers.get_scaled_pixbuf(pixbuf, 'roster')
 | 
			
		||||
		model[iter][C_AVATAR] = scaled_pixbuf
 | 
			
		||||
 | 
			
		||||
	def chg_contact_status(self, nick, show, status, role, affiliation, jid,
 | 
			
		||||
| 
						 | 
				
			
			@ -1198,7 +1195,8 @@ class GroupchatControl(ChatControlBase):
 | 
			
		|||
				affiliation = affiliation, jid = j, resource = resource)
 | 
			
		||||
			gajim.contacts.add_gc_contact(self.account, gc_contact)
 | 
			
		||||
		self.draw_contact(nick)
 | 
			
		||||
		self.draw_avatar(nick)
 | 
			
		||||
		if gajim.config.get('show_avatars_in_roster'):
 | 
			
		||||
			self.draw_avatar(nick)
 | 
			
		||||
		# Do not ask avatar to irc rooms as irc transports reply with messages
 | 
			
		||||
		server = gajim.get_server_from_jid(self.room_jid)
 | 
			
		||||
		if gajim.config.get('ask_avatars_on_startup') and \
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -482,7 +482,8 @@ class RosterWindow:
 | 
			
		|||
		jid = gajim.get_jid_from_account(account)
 | 
			
		||||
		if self.get_self_contact_iter(account):
 | 
			
		||||
			self.draw_contact(jid, account)
 | 
			
		||||
			self.draw_avatar(jid, account)
 | 
			
		||||
			if gajim.config.get('show_avatars_in_roster'):
 | 
			
		||||
				self.draw_avatar(jid, account)
 | 
			
		||||
			return
 | 
			
		||||
 | 
			
		||||
		contact = gajim.contacts.get_first_contact_from_jid(account, jid)
 | 
			
		||||
| 
						 | 
				
			
			@ -498,7 +499,8 @@ class RosterWindow:
 | 
			
		|||
		model.append(iterAcct, (None, gajim.nicks[account], 'self_contact', jid,
 | 
			
		||||
			account, None, None))
 | 
			
		||||
		self.draw_contact(jid, account)
 | 
			
		||||
		self.draw_avatar(jid, account)
 | 
			
		||||
		if gajim.config.get('show_avatars_in_roster'):
 | 
			
		||||
			self.draw_avatar(jid, account)
 | 
			
		||||
 | 
			
		||||
	def add_transport_to_roster(self, account, transport):
 | 
			
		||||
		c = gajim.contacts.create_contact(jid = transport, name = transport,
 | 
			
		||||
| 
						 | 
				
			
			@ -1932,7 +1934,8 @@ class RosterWindow:
 | 
			
		|||
 | 
			
		||||
	def update_avatar_in_gui(self, jid, account):
 | 
			
		||||
		# Update roster
 | 
			
		||||
		self.draw_avatar(jid, account)
 | 
			
		||||
		if gajim.config.get('show_avatars_in_roster'):
 | 
			
		||||
			self.draw_avatar(jid, account)
 | 
			
		||||
		# Update chat window
 | 
			
		||||
		if gajim.interface.msg_win_mgr.has_window(jid, account):
 | 
			
		||||
			win = gajim.interface.msg_win_mgr.get_window(jid, account)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue