Skip to content

Commit

Permalink
fix lavatar shows same letters for every contact not having a photo
Browse files Browse the repository at this point in the history
caused by wrongly falling back to the contact with contact_id equal to account_id of current user
  • Loading branch information
ralfbecker committed Jul 27, 2023
1 parent 9047f85 commit ae76eea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/js/etemplate/Et2Avatar/Et2Avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class Et2Avatar extends Et2Widget(SlotMixin(SlAvatar)) implements et2_IDe

if (!_contactId)
{
parsedId = this.egw().user('account_id');
parsedId = null;
}
else if(_contactId.substr(0, 8) === 'account:')
{
Expand All @@ -200,7 +200,11 @@ export class Et2Avatar extends Et2Widget(SlotMixin(SlAvatar)) implements et2_IDe
let oldContactId = this._contactId;
this._contactId = _contactId;
// if our image (incl. cache-buster) already includes the correct id, use that one
if(!this.image || !this.image.match("(&|\\?)" + id + "=" + encodeURIComponent(parsedId) + "(&|$)"))
if (!parsedId)
{
this.image = null;
}
else if(!this.image || !this.image.match("(&|\\?)" + id + "=" + encodeURIComponent(parsedId) + "(&|$)"))
{
params[id] = parsedId;
this.image = egw.link('/api/avatar.php', params);
Expand Down

0 comments on commit ae76eea

Please sign in to comment.