comparison cagou/plugins/plugin_wid_chat.py @ 458:1dd6db69406a

core: update avatar handling following backend changes: new avatar data format is handled. When ContactItem is created, avatar and nicknames are requested to backend if they are not already in cache.
author Goffi <goffi@goffi.org>
date Tue, 14 Apr 2020 21:14:44 +0200
parents 642cd2435e26
children 3c9ba4a694ef
comparison
equal deleted inserted replaced
457:ec11a35dcf14 458:1dd6db69406a
318 def info_type(self): 318 def info_type(self):
319 return self.mess_data.info_type 319 return self.mess_data.info_type
320 320
321 def update(self, update_dict): 321 def update(self, update_dict):
322 if 'avatar' in update_dict: 322 if 'avatar' in update_dict:
323 self.avatar.source = update_dict['avatar'] 323 avatar_data = update_dict['avatar']
324 if avatar_data is None:
325 source = G.host.getDefaultAvatar()
326 else:
327 source = avatar_data['path']
328 self.avatar.source = source
324 if 'status' in update_dict: 329 if 'status' in update_dict:
325 status = update_dict['status'] 330 status = update_dict['status']
326 self.delivery.text = '\u2714' if status == 'delivered' else '' 331 self.delivery.text = '\u2714' if status == 'delivered' else ''
327 332
328 def _setPath(self, data, path): 333 def _setPath(self, data, path):